diff --git a/Rakefile b/Rakefile index d3e5656f..a7f65995 100644 --- a/Rakefile +++ b/Rakefile @@ -47,7 +47,7 @@ begin rescue LoadError end -task :default => :test +task :default => [:test, :features] # console diff --git a/features/post_data.feature b/features/post_data.feature index 87920237..fa5f4e79 100644 --- a/features/post_data.feature +++ b/features/post_data.feature @@ -120,15 +120,18 @@ Feature: Post data Scenario: Disable a post from being published Given I have a _posts directory + And I have an "index.html" file that contains "Published!" 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 + And I should see "Published!" in "_site/index.html" Scenario: Use a custom variable Given I have a _posts directory + And I have a _layouts 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. | diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb index ad2d5cfb..87e2b5a0 100644 --- a/features/step_definitions/jekyll_steps.rb +++ b/features/step_definitions/jekyll_steps.rb @@ -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'}") 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] end matter = matter_hash.map { |k, v| "#{k}: #{v}\n" }.join.chomp @@ -100,7 +100,7 @@ Then /^I should see "(.*)" in "(.*)"$/ do |text, file| end Then /^the "(.*)" file should not exist$/ do |file| - pending + assert !File.exists?(file) end Then /^I should see today's date in "(.*)"$/ do |file|