Fixed my tests, I need more specific tests for the new command.

This commit is contained in:
zachgersh 2013-06-04 00:43:33 -07:00
parent b19997aee4
commit 3fdeb8c591
2 changed files with 12 additions and 3 deletions

View File

@ -6,9 +6,9 @@ Feature: Create sites
Scenario: Blank site Scenario: Blank site
Given I do not have a "test_blank" directory Given I do not have a "test_blank" directory
When I call jekyll new with test_blank --blank When I call jekyll new with test_blank --blank
Then the _layouts directory should exist Then the _layouts directory should exist in the test_blank path
And the _posts directory should exist And the _posts directory should exist in the test_blank path
And the "index.html" file should exist And the "index.html" file should exist in the test_blank path
Scenario: Basic site Scenario: Basic site
Given I have an "index.html" file that contains "Basic Site" Given I have an "index.html" file that contains "Basic Site"

View File

@ -140,6 +140,15 @@ Then /^the (.*) directory should exist$/ do |dir|
assert File.directory?(dir), "The directory \"#{dir}\" does not exist" assert File.directory?(dir), "The directory \"#{dir}\" does not exist"
end end
Then /^the "(.*)" file should exist in the (.*) path$/ do |file, path|
assert File.file?("#{TEST_DIR}/#{path}/#{file}")
end
Then /^the (.*) directory should exist in the (.*) path$/ do |dir, path|
assert File.directory?("#{TEST_DIR}/#{path}/#{dir}"),
"The directory \"#{dir}\" does not exist"
end
Then /^I should see "(.*)" in "(.*)"$/ do |text, file| Then /^I should see "(.*)" in "(.*)"$/ do |text, file|
assert Regexp.new(text).match(File.open(file).readlines.join) assert Regexp.new(text).match(File.open(file).readlines.join)
end end