diff --git a/features/create_sites.feature b/features/create_sites.feature index 404257cb8df..f9cedf4fd5a 100644 --- a/features/create_sites.feature +++ b/features/create_sites.feature @@ -17,7 +17,6 @@ Feature: Create sites When I run jekyll Then the _site directory should exist And the _site/posts directory should exist - And the _site/posts/2009/03/24/hackers.html file should exist And I should see "My First Exploit" in "_site/posts/2009/03/24/hackers.html" Scenario: Basic site with layout @@ -39,7 +38,6 @@ Feature: Create sites When I run jekyll Then the _site directory should exist And the _site/posts directory should exist - And the _site/posts/2009/03/24/hackers.html file should exist And I should see "My First Exploit" in "_site/posts/2009/03/24/hackers.html" And I should see "Basic Site with Layout and a Post: My First Exploit" in "_site/index.html" diff --git a/features/embed_filters.feature b/features/embed_filters.feature index bdf5900450a..85e6a45a7ae 100644 --- a/features/embed_filters.feature +++ b/features/embed_filters.feature @@ -4,7 +4,48 @@ Feature: Embed filters In order to perform cool stuff in my posts Scenario: Convert date to XML schema + Given I have a blank site + And I have a post titled "Date to XML schema" for "3/26/2009" that contains "{{ post.date | date_to_xmlschema }}" + When I run jekyll + Then the _site directory should exist + And the _site/posts directory should exist + And the _site/posts/2009/03/26/date-to-xml-schema.html file should exist + And I should see "2009-03-26T00:00:00-08:00" in "_site/posts/2009/03/26/date-to-xml-schema.html" + Scenario: Escape text for XML + Given I have a blank site + And I have a post titled "Escape text for XML" for "3/26/2009" that contains "{{ 'Mario & Luigi' | xml_escape }}" + When I run jekyll + Then the _site directory should exist + And the _site/posts directory should exist + And the _site/posts/2009/03/26/escape-text-for-xml.html file should exist + And I should see "<tt>Mario & Luigi<tt>" in "_site/posts/2009/03/26/escape-text-for-xml.html" + Scenario: Calculate number of words + Given I have a blank site + And I have a post titled "Calculate number of words" for "3/26/2009" that contains "{{ post.title | number_of_words }}" + When I run jekyll + Then the _site directory should exist + And the _site/posts directory should exist + And the _site/posts/2009/03/26/calculate-number-of-words.html file should exist + And I should see "4" in "_site/posts/2009/03/26/calculate-number-of-words.html" + Scenario: Convert an array into a sentence + Given I have a blank site + 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" + When I run jekyll + Then the _site directory should exist + And the _site/posts directory should exist + And the _site/posts/2009/03/26/convert-array-to-sentence.html file should exist + And I should see "life, hacks, and code" in "_site/posts/2009/03/26/convert-array-to-sentence.html" + Scenario: Textilize a given string + Given I have a blank site + 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*" + When I run jekyll + Then the _site directory should exist + And the _site/posts directory should exist + And the _site/posts/2009/03/26/textilize.html file should exist + And I should see "Mr. Spock" in "_site/posts/2009/03/26/textilize.html" diff --git a/features/site_configuration.feature b/features/site_configuration.feature index 03198a7c758..df3185ef542 100644 --- a/features/site_configuration.feature +++ b/features/site_configuration.feature @@ -3,6 +3,14 @@ Feature: Site configuration I want to be able to configure jekyll In order to make setting up a site easier + Scenario: Change destination directory + Given I have a blank site in "_sourcedir" + And I have an "index.html" file that contains "Changing source directory" + And I have a configuration file in "_sourcedir" with "source" set to "_sourcedir" + When I run jekyll + Then the _site directory should exist + And I should see "Changing source directory" in "_site/index.html" + Scenario: Change destination directory Given I have a blank site And I have an "index.html" file that contains "Changing destination directory" @@ -36,9 +44,18 @@ Feature: Site configuration Then the _site directory should exist And I should see "My awesome site" in "_site/index.html" + Scenario: Run server to host generated site + Given I have a blank site + And I have an "index.html" file that contains "WEBrick to the rescue" + And I have a configuration file with "server" set to "true" + When I run jekyll + And I go to "http://0.0.0.0:4000" + Then I should see "WEBrick to the rescue" + Scenario: Run server on a different server port Given I have a blank site And I have an "index.html" file that contains "Changing Port" + And I have a configuration file with "server" set to "true" And I have a configuration file with "port" set to "1337" When I run jekyll And I go to "http://0.0.0.0:1337" @@ -52,7 +69,6 @@ Feature: Site configuration When I run jekyll Then the _site directory should exist And the _site/posts directory should exist - And the _site/posts/none-permalink-schema.html file should exist And I should see "Whoa." in "_site/posts/none-permalink-schema.html" Scenario: Use pretty permalink schema @@ -64,8 +80,12 @@ Feature: Site configuration Then the _site directory should exist And the _site/posts directory should exist And the _site/posts/pretty-permalink-schema directory should exist - And the _site/posts/pretty-permalink-schema/index.html file should exist And I should see "Whoa." in "_site/posts/pretty-permalink-schema/index.html" Scenario: Highlight code with pygments - + Given I have a blank site + And I have an "index.html" file that contains "{% highlight ruby %} puts 'Hello world!' {% endhighlight %}" + And I have a configuration file with "pygments" set to "true" + When I run jekyll + Then the _site directory should exist + And I should see "puts 'Hello world!'" in "_site/index.html" diff --git a/features/site_data.feature b/features/site_data.feature index 8a5140893ca..4f52e9ad33a 100644 --- a/features/site_data.feature +++ b/features/site_data.feature @@ -4,8 +4,29 @@ Feature: Site data In order to make the site slightly dynamic Scenario: Use page variable in a page + Given I have a blank site + And I have an "contact.html" file with title "Contact" that contains "{{ page.title }}: email@me.com" + When I run jekyll + Then the _site directory should exist + And I should see "Contact: email@me.com" in "_site/index.html" + Scenario: Use site.time variable - Scenario: Use site.posts variable + Given I have a blank site + And I have an "index.html" file that contains "Generated on: {{ site.time }}" + When I run jekyll + Then the _site directory should exist + And I should see "Generated on: #{Date.today.strftime("%Y-%m-%d")}" in "_site/index.html" + + Scenario: Use site.posts variable for first post + Given I have a blank site + 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 "Whoa." + And I have a post titled "Pretty Permalink Schema" for "3/25/2009" that contains "Whoa." + And I have a post titled "Pretty Permalink Schema" for "3/25/2009" that contains "Whoa." + When I run jekyll + Then the _site directory should exist + And I should see "Generated on: #{Date.today.strftime("%Y-%m-%d")}" in "_site/index.html" + Scenario: Use site.categories variable Scenario: Use site.categories.life variable Scenario: Use site.related_posts variable