Skip to content

Commit

Permalink
Getting there with the stories...slowly but surely
Browse files Browse the repository at this point in the history
  • Loading branch information
qrush committed Mar 26, 2009
1 parent 9d4e169 commit ea2175b
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 6 deletions.
2 changes: 0 additions & 2 deletions features/create_sites.feature
Expand Up @@ -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
Expand All @@ -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"

Expand Down
41 changes: 41 additions & 0 deletions features/embed_filters.feature
Expand Up @@ -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 "{{ '<tt>Mario & Luigi</tt>' | 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 "&lt;tt&gt;Mario &amp; Luigi&lt;tt&gt;" 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 "<b>Mr. Spock</b>" in "_site/posts/2009/03/26/textilize.html"
26 changes: 23 additions & 3 deletions features/site_configuration.feature
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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"
23 changes: 22 additions & 1 deletion features/site_data.feature
Expand Up @@ -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

0 comments on commit ea2175b

Please sign in to comment.