diff --git a/features/create_sites.feature b/features/create_sites.feature
index 6287b2b3..b67b1615 100644
--- a/features/create_sites.feature
+++ b/features/create_sites.feature
@@ -13,10 +13,12 @@ Feature: Create sites
Scenario: Basic site with a post
Given I have a blank site
And I have a _posts directory
- And I have a post titled "Hackers" for "3/24/2009" that contains "My First Exploit"
+ And I have the following post:
+ | title | date | content |
+ | Hackers | 3/27/2009 | My First Exploit |
When I run jekyll
Then the _site directory should exist
- And I should see "My First Exploit" in "_site/2009/03/24/hackers.html"
+ And I should see "My First Exploit" in "_site/2009/03/27/hackers.html"
Scenario: Basic site with layout and a page
Given I have a blank site
@@ -31,12 +33,13 @@ Feature: Create sites
Given I have a blank site
And I have a _layouts directory
And I have a _posts directory
- And I have a post titled "Wargames" for "3/26/2009" that contains "Would you like to play a game?"
- And I have a post titled "Wargames" for "3/26/2009" with layout "default"
+ And I have the following post:
+ | title | date | layout | content |
+ | Wargames | 3/27/2009 | default | Would you like to play a game?" |
And I have a default layout that contains "Post Layout: {{ content }}"
When I run jekyll
Then the _site directory should exist
- And I should see "Post Layout: Would you like to play a game?" in "_site/2009/03/26/wargames.html"
+ And I should see "Post Layout: Would you like to play a game?" in "_site/2009/03/27/wargames.html"
Scenario: Basic site with include tag
Given I have a blank site
diff --git a/features/embed_filters.feature b/features/embed_filters.feature
index 99f629b0..33429d12 100644
--- a/features/embed_filters.feature
+++ b/features/embed_filters.feature
@@ -6,42 +6,50 @@ Feature: Embed filters
Scenario: Convert date to XML schema
Given I have a blank site
And I have a _posts directory
- And I have a post titled "Date to XML schema" for "3/26/2009" that contains "{{ post.date | date_to_xmlschema }}"
+ And I have the following post:
+ | title | date | content |
+ | Date to XML schema | 3/27/2009 | {{ post.date | date_to_xmlschema }} |
When I run jekyll
Then the _site directory should exist
- And the _site/2009/03/26/date-to-xml-schema.html file should exist
- And I should see "2009-03-26T00:00:00-08:00" in "_site/2009/03/26/date-to-xml-schema.html"
+ And I should see "2009-03-27T00:00:00-08:00" in "_site/2009/03/27/date-to-xml-schema.html"
Scenario: Escape text for XML
Given I have a blank site
And I have a _posts directory
- And I have a post titled "Escape text for XML" for "3/26/2009" that contains "{{ 'Mario & Luigi' | xml_escape }}"
+ And I have the following post:
+ | title | date | content |
+ | Escape text for XML | 3/27/2009 | {{ 'Mario & Luigi' | xml_escape }} |
When I run jekyll
Then the _site directory should exist
- And I should see "<tt>Mario & Luigi<tt>" in "_site/2009/03/26/escape-text-for-xml.html"
+ And I should see "<tt>Mario & Luigi<tt>" in "_site/2009/03/27/escape-text-for-xml.html"
Scenario: Calculate number of words
Given I have a blank site
And I have a _posts directory
- And I have a post titled "Calculate number of words" for "3/26/2009" that contains "{{ post.title | number_of_words }}"
+ And I have the following post:
+ | title | date | content |
+ | Calculate number of words | 3/27/2009 | {{ post.title | number_of_words }} |
When I run jekyll
Then the _site directory should exist
- And I should see "4" in "_site/2009/03/26/calculate-number-of-words.html"
+ And I should see "4" in "_site/2009/03/27/calculate-number-of-words.html"
Scenario: Convert an array into a sentence
Given I have a blank site
And I have a _posts directory
- And I have a post titled "Convert array to sentence" for "3/26/2009" with that contains "{{ post.tags | array_to_sentence_string }}"
- And I have a post titled "Convert array to sentence" for "3/26/2009" with tags "life hacks code"
+ And I have the following post:
+ | title | date | tags | content |
+ | Convert array to sentence | 3/27/2009 | life hacks code | {{ post.tags | array_to_sentence_string }} |
When I run jekyll
Then the _site directory should exist
- And I should see "life, hacks, and code" in "_site/2009/03/26/convert-array-to-sentence.html"
+ And I should see "life, hacks, and code" in "_site/2009/03/27/convert-array-to-sentence.html"
Scenario: Textilize a given string
Given I have a blank site
And I have a _posts directory
- And I have a post titled "Textilize" for "3/26/2009" with that contains "{{ post.author | textilize }}"
- And I have a post titled "Textilize" for "3/26/2009" with author "*Mr. Spock*"
+ And I have the following post:
+ | title | date | tags | content |
+ | Logical Awesome | 3/27/2009 | *Mr. Spock* | {{ post.author | textilize }} |
When I run jekyll
Then the _site directory should exist
- And I should see "Mr. Spock" in "_site/2009/03/26/textilize.html"
+ And I should see "Mr. Spock" in "_site/2009/03/27/textilize.html"
+
diff --git a/features/post_data.feature b/features/post_data.feature
index 8407cc32..f7938f36 100644
--- a/features/post_data.feature
+++ b/features/post_data.feature
@@ -7,29 +7,143 @@ Feature: Post data
Given I have a blank site
And I have a _posts directory
And I have a _layouts directory
- And I have a post for "3/26/2009" with title "Star Wars" and with layout "simple" and with content "C3P0!!"
+ And I have the following post:
+ | title | date | layout | content |
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
And I have a simple layout that contains "Post title: {{ post.title }}"
When I run jekyll
Then the _site directory should exist
- And I should see "Post title: Star Wars" in "_site/2009/03/26/star-wars.html"
+ And I should see "Post title: Star Wars" in "_site/2009/03/27/star-wars.html"
Scenario: Use post.url variable
Given I have a blank site
And I have a _posts directory
And I have a _layouts directory
- And I have a post for "3/26/2009" with title "Star Wars" and with layout "simple" and with content "C3P0!!"
+ And I have the following post:
+ | title | date | layout | content |
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
And I have a simple layout that contains "Post url: {{ post.url }}"
When I run jekyll
Then the _site directory should exist
- And I should see "Post url: /2009/03/26/star-wars.html" in "_site/2009/03/26/star-wars.html"
+ And I should see "Post url: /2009/03/27/star-wars.html" in "_site/2009/03/27/star-wars.html"
Scenario: Use post.date variable
+ Given I have a blank site
+ And I have a _posts directory
+ And I have a _layouts directory
+ And I have the following post:
+ | title | date | layout | content |
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
+ And I have a simple layout that contains "Post date: {{ post.date }}"
+ When I run jekyll
+ Then the _site directory should exist
+ And I should see "Post url: 2009-03-27" in "_site/2009/03/27/star-wars.html"
+
Scenario: Use post.id variable
+ Given I have a blank site
+ And I have a _posts directory
+ And I have a _layouts directory
+ And I have the following post:
+ | title | date | layout | content |
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
+ And I have a simple layout that contains "Post id: {{ post.id }}"
+ When I run jekyll
+ Then the _site directory should exist
+ And I should see "Post id: /2009/03/27/star-wars" in "_site/2009/03/27/star-wars.html"
+
Scenario: Use post.content variable
+ Given I have a blank site
+ And I have a _posts directory
+ And I have a _layouts directory
+ And I have the following post:
+ | title | date | layout | content |
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
+ And I have a simple layout that contains "Post content: {{ post.content }}"
+ When I run jekyll
+ Then the _site directory should exist
+ And I should see "Post content: Luke, I am your father." in "_site/2009/03/27/star-wars.html"
+
Scenario: Use post.categories variable when category is in a folder
+ Given I have a blank site
+ And I have a movies directory
+ And I have a movies/_posts directory
+ And I have a _layouts directory
+ And I have the following post in "movies":
+ | title | date | layout | content |
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
+ And I have a simple layout that contains "Post category: {{ post.categories }}"
+ When I run jekyll
+ Then the _site directory should exist
+ And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html"
+
Scenario: Use post.categories variable when categories are in folders
- Scenario: Use post.categories variable when categories are in YAML
+ Given I have a blank site
+ And I have a movies directory
+ And I have a movies/scifi directory
+ And I have a movies/scifi/_posts directory
+ And I have a _layouts directory
+ And I have the following post in "movies/scifi":
+ | title | date | layout | content |
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
+ And I have a simple layout that contains "Post categories: {{ post.categories }}"
+ When I run jekyll
+ Then the _site directory should exist
+ And I should see "Post categories: movies scifi" in "_site/movies/scifi/2009/03/27/star-wars.html"
+
Scenario: Use post.categories variable when category is in YAML
+ Given I have a blank site
+ And I have a _posts directory
+ And I have a _layouts directory
+ And I have the following post:
+ | title | date | layout | category | content |
+ | Star Wars | 3/27/2009 | simple | movies | Luke, I am your father. |
+ And I have a simple layout that contains "Post category: {{ post.categories }}"
+ When I run jekyll
+ Then the _site directory should exist
+ And I should see "Post categories: movies" in "_site/movies/2009/03/27/star-wars.html"
+
+ Scenario: Use post.categories variable when categories are in YAML
+ Given I have a blank site
+ And I have a _posts directory
+ And I have a _layouts directory
+ And I have the following post:
+ | title | date | layout | categories | content |
+ | Star Wars | 3/27/2009 | simple | movies, scifi | Luke, I am your father. |
+ And I have a simple layout that contains "Post categories: {{ post.categories }}"
+ When I run jekyll
+ Then the _site directory should exist
+ And I should see "Post categories: movies scifi" in "_site/movies/scifi/2009/03/27/star-wars.html"
+
Scenario: Use post.topics variable
+ Given I have a blank site
+ And I have a _posts directory
+ And I have a _posts/movies directory
+ And I have a _posts/movies/scifi directory
+ And I have the following post:
+ | title | date | layout | content |
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
+ And I have a simple layout that contains "Post topics: {{ post.topics }}"
+ When I run jekyll
+ Then the _site directory should exist
+ And I should see "Post topics: movies scifi" in "_site/2009/03/27/star-wars.html"
+
Scenario: Disable a post from being published
+ Given I have a blank site
+ And I have a _posts directory
+ And I have the following post:
+ | title | date | layout | published | content |
+ | Star Wars | 3/27/2009 | simple | false | Luke, I am your father. |
+ When I run jekyll
+ Then the _site directory should exist
+ And the "_site/2009/03/27/star-wars.html" file should not exist
+
Scenario: Use a custom variable
+ Given I have a blank site
+ And I have a _posts directory
+ And I have the following post:
+ | title | date | layout | author | content |
+ | Star Wars | 3/27/2009 | simple | Darth Vader | Luke, I am your father. |
+ And I have a simple layout that contains "Post author: {{ post.author }}"
+ When I run jekyll
+ Then the _site directory should exist
+ And I should see "Post author: Darth Vader" in "_site/2009/03/27/star-wars.html"
diff --git a/features/site_configuration.feature b/features/site_configuration.feature
index db41d766..101fbe8d 100644
--- a/features/site_configuration.feature
+++ b/features/site_configuration.feature
@@ -64,20 +64,24 @@ Feature: Site configuration
Scenario: Use none permalink schema
Given I have a blank site
And I have a _posts directory
- And I have a post titled "None Permalink Schema" for "3/25/2009" that contains "Whoa."
+ And I have the following post:
+ | title | date | content |
+ | None Permalink Schema | 3/27/2009 | Totally nothing. |
And I have a configuration file with "permalink" set to "none"
When I run jekyll
Then the _site directory should exist
- And I should see "Whoa." in "_site/none-permalink-schema.html"
+ And I should see "Totally nothing." in "_site/none-permalink-schema.html"
Scenario: Use pretty permalink schema
Given I have a blank site
And I have a _posts directory
- And I have a post titled "Pretty Permalink Schema" for "3/25/2009" that contains "Whoa."
+ And I have the following post:
+ | title | date | content |
+ | Pretty Permalink Schema | 3/27/2009 | Totally wordpress. |
And I have a configuration file with "permalink" set to "pretty"
When I run jekyll
Then the _site directory should exist
- And I should see "Whoa." in "_site/2009/03/25/pretty-permalink-schema/index.html"
+ And I should see "Totally wordpress." in "_site/2009/03/27/pretty-permalink-schema/index.html"
Scenario: Highlight code with pygments
Given I have a blank site
diff --git a/features/site_data.feature b/features/site_data.feature
index a768912f..773e1b09 100644
--- a/features/site_data.feature
+++ b/features/site_data.feature
@@ -21,9 +21,11 @@ Feature: Site data
Given I have a blank site
And I have a _posts directory
And I have an "index.html" file that contains "{{ site.posts.first.title }}: {{ site.posts.first.url }}"
- And I have a post titled "First Post" for "3/25/2009" that contains "First!"
- And I have a post titled "Second Post" for "3/26/2009" that contains "Second!"
- And I have a post titled "Third Post" for "3/27/2009" that contains "Third!"
+ And I have the following posts:
+ | title | date | content |
+ | First Post | 3/25/2009 | My First Post |
+ | Second Post | 3/26/2009 | My Second Post |
+ | Third Post | 3/27/2009 | My Third Post |
When I run jekyll
Then the _site directory should exist
And I should see "Third Post: /2009/03/27/third-post.html" in "_site/index.html"
@@ -32,9 +34,11 @@ Feature: Site data
Given I have a blank site
And I have a _posts directory
And I have an "index.html" file that contains "{% for post in site.posts %} {{ post.title }} {% endfor %}"
- And I have a post titled "First Post" for "3/25/2009" that contains "First!"
- And I have a post titled "Second Post" for "3/26/2009" that contains "Second!"
- And I have a post titled "Third Post" for "3/27/2009" that contains "Third!"
+ And I have the following posts:
+ | title | date | content |
+ | First Post | 3/25/2009 | My First Post |
+ | Second Post | 3/26/2009 | My Second Post |
+ | Third Post | 3/27/2009 | My Third Post |
When I run jekyll
Then the _site directory should exist
And I should see "Third Post Second Post First Post" in "_site/index.html"
@@ -43,10 +47,10 @@ Feature: Site data
Given I have a blank site
And I have a _posts directory
And I have an "index.html" file that contains "{% for post in site.categories.code %} {{ post.title }} {% endfor %}"
- And I have a post titled "Awesome Hack" for "3/26/2009" that contains "while(true) { puts 'infinity' }"
- And I have a post titled "Awesome Hack" for "3/26/2009" with category "code"
- And I have a post titled "Delicious Beer" for "3/26/2009" that contains "# Yuengling"
- And I have a post titled "Delicious Beer" for "3/26/2009" with category "food"
+ And I have the following posts:
+ | title | date | category | content |
+ | Awesome Hack | 3/26/2009 | code | puts 'Hello World' |
+ | Delicious Beer | 3/26/2009 | food | 1) Yuengling |
When I run jekyll
Then the _site directory should exist
And I should see "Awesome Hack" in "_site/index.html"