diff --git a/features/create_sites.feature b/features/create_sites.feature index cbdfb64b..4811cdbf 100644 --- a/features/create_sites.feature +++ b/features/create_sites.feature @@ -110,3 +110,14 @@ Feature: Create sites When I run jekyll Then the _site directory should exist And I should see "SomeDirective" in "_site/.htaccess" + + Scenario: File was replaced by a directory + Given I have a "test" file that contains "some stuff" + When I run jekyll + Then the _site directory should exist + When I delete the file "test" + Given I have a test directory + And I have a "test/index.html" file that contains "some other stuff" + When I run jekyll + Then the _site/test directory should exist + And I should see "some other stuff" in "_site/test/index.html" diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb index 75330738..4e68f9b8 100644 --- a/features/step_definitions/jekyll_steps.rb +++ b/features/step_definitions/jekyll_steps.rb @@ -140,6 +140,10 @@ When /^I change "(.*)" to contain "(.*)"$/ do |file, text| end end +When /^I delete the file "(.*)"$/ do |file| + File.delete(file) +end + Then /^the (.*) directory should exist$/ do |dir| assert File.directory?(dir), "The directory \"#{dir}\" does not exist" end