Added features to default rake task, and post data feature all green
This commit is contained in:
parent
03f511be61
commit
3c0bc3b2de
2
Rakefile
2
Rakefile
|
@ -47,7 +47,7 @@ begin
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
end
|
end
|
||||||
|
|
||||||
task :default => :test
|
task :default => [:test, :features]
|
||||||
|
|
||||||
# console
|
# console
|
||||||
|
|
||||||
|
|
|
@ -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. |
|
||||||
|
|
|
@ -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|
|
||||||
|
|
Loading…
Reference in New Issue