-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
/
post_excerpts.feature
72 lines (68 loc) · 3.73 KB
/
post_excerpts.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Feature: Post excerpts
As a hacker who likes to blog
I want to be able to make a static site
In order to share my awesome ideas with the interwebs
But some people can only focus for a few moments
So just give them a taste
Scenario: An excerpt without a layout
Given I have an "index.html" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}"
And I have a _posts directory
And I have the following posts:
| title | date | layout | content |
| entry1 | 2007-12-31 | post | content for entry1. |
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see exactly "<p>content for entry1.</p>" in "_site/index.html"
Scenario: An excerpt from a post with a layout
Given I have an "index.html" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}"
And I have a _posts directory
And I have a _layouts directory
And I have a post layout that contains "{{ page.excerpt }}"
And I have the following posts:
| title | date | layout | content |
| entry1 | 2007-12-31 | post | content for entry1. |
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And the _site/2007 directory should exist
And the _site/2007/12 directory should exist
And the _site/2007/12/31 directory should exist
And the "_site/2007/12/31/entry1.html" file should exist
And I should see exactly "<p>content for entry1.</p>" in "_site/2007/12/31/entry1.html"
And I should see exactly "<p>content for entry1.</p>" in "_site/index.html"
Scenario: An excerpt with Liquid constructs from a post with a layout
Given I have an "index.html" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}"
And I have a configuration file with "baseurl" set to "/blog"
And I have a _posts directory
And I have a _layouts directory
And I have a post layout that contains "{{ page.excerpt }}"
And I have the following posts:
| title | date | layout | content |
| entry1 | 2007-12-31 | post | {{ 'assets/style.css' \| relative_url }} |
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And the _site/2007 directory should exist
And the _site/2007/12 directory should exist
And the _site/2007/12/31 directory should exist
And the "_site/2007/12/31/entry1.html" file should exist
And I should see exactly "<p>/blog/assets/style.css</p>" in "_site/2007/12/31/entry1.html"
And I should see exactly "<p>/blog/assets/style.css</p>" in "_site/index.html"
Scenario: An excerpt from a post with a layout which has context
Given I have an "index.html" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}"
And I have a _posts directory
And I have a _layouts directory
And I have a post layout that contains "<html><head></head><body>{{ page.excerpt }}</body></html>"
And I have the following posts:
| title | date | layout | content |
| entry1 | 2007-12-31 | post | content for entry1. |
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And the _site/2007 directory should exist
And the _site/2007/12 directory should exist
And the _site/2007/12/31 directory should exist
And the "_site/2007/12/31/entry1.html" file should exist
And I should see "<p>content for entry1.</p>" in "_site/index.html"
And I should see "<html><head></head><body><p>content for entry1.</p>\n</body></html>" in "_site/2007/12/31/entry1.html"