From 3fdeb8c59149940fb37dcba4b66311e768460e1f Mon Sep 17 00:00:00 2001 From: zachgersh Date: Tue, 4 Jun 2013 00:43:33 -0700 Subject: [PATCH] Fixed my tests, I need more specific tests for the new command. --- features/create_sites.feature | 6 +++--- features/step_definitions/jekyll_steps.rb | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/features/create_sites.feature b/features/create_sites.feature index 8d85f084..b84fac8a 100644 --- a/features/create_sites.feature +++ b/features/create_sites.feature @@ -6,9 +6,9 @@ Feature: Create sites Scenario: Blank site Given I do not have a "test_blank" directory When I call jekyll new with test_blank --blank - Then the _layouts directory should exist - And the _posts directory should exist - And the "index.html" file should exist + Then the _layouts directory should exist in the test_blank path + And the _posts directory should exist in the test_blank path + And the "index.html" file should exist in the test_blank path Scenario: Basic site Given I have an "index.html" file that contains "Basic Site" diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb index 97567255..602b25db 100644 --- a/features/step_definitions/jekyll_steps.rb +++ b/features/step_definitions/jekyll_steps.rb @@ -140,6 +140,15 @@ Then /^the (.*) directory should exist$/ do |dir| assert File.directory?(dir), "The directory \"#{dir}\" does not exist" 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| assert Regexp.new(text).match(File.open(file).readlines.join) end