Added features to default rake task, and post data feature all green

This commit is contained in:
Nick Quaranto 2009-04-01 16:40:30 -04:00
parent 03f511be61
commit 3c0bc3b2de
3 changed files with 6 additions and 3 deletions

View File

@ -47,7 +47,7 @@ begin
rescue LoadError rescue LoadError
end end
task :default => :test task :default => [:test, :features]
# console # console

View File

@ -120,15 +120,18 @@ Feature: Post data
Scenario: Disable a post from being published Scenario: Disable a post from being published
Given I have a _posts directory Given I have a _posts directory
And I have an "index.html" file that contains "Published!"
And I have the following post: And I have the following post:
| title | date | layout | published | content | | title | date | layout | published | content |
| Star Wars | 3/27/2009 | simple | false | Luke, I am your father. | | Star Wars | 3/27/2009 | simple | false | Luke, I am your father. |
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And the "_site/2009/03/27/star-wars.html" file should not exist And the "_site/2009/03/27/star-wars.html" file should not exist
And I should see "Published!" in "_site/index.html"
Scenario: Use a custom variable Scenario: Use a custom variable
Given I have a _posts directory Given I have a _posts directory
And I have a _layouts directory
And I have the following post: And I have the following post:
| title | date | layout | author | content | | title | date | layout | author | content |
| Star Wars | 3/27/2009 | simple | Darth Vader | Luke, I am your father. | | Star Wars | 3/27/2009 | simple | Darth Vader | Luke, I am your father. |

View File

@ -53,7 +53,7 @@ Given /^I have the following posts?(?: (.*) "(.*)")?:$/ do |direction, folder, t
path = File.join(before || '.', '_posts', after || '.', "#{date}-#{title}.#{post['type'] || 'textile'}") path = File.join(before || '.', '_posts', after || '.', "#{date}-#{title}.#{post['type'] || 'textile'}")
matter_hash = {} matter_hash = {}
%w(title layout tags category categories).each do |key| %w(title layout tags category categories published author).each do |key|
matter_hash[key] = post[key] if post[key] matter_hash[key] = post[key] if post[key]
end end
matter = matter_hash.map { |k, v| "#{k}: #{v}\n" }.join.chomp matter = matter_hash.map { |k, v| "#{k}: #{v}\n" }.join.chomp
@ -100,7 +100,7 @@ Then /^I should see "(.*)" in "(.*)"$/ do |text, file|
end end
Then /^the "(.*)" file should not exist$/ do |file| Then /^the "(.*)" file should not exist$/ do |file|
pending assert !File.exists?(file)
end end
Then /^I should see today's date in "(.*)"$/ do |file| Then /^I should see today's date in "(.*)"$/ do |file|