From b19997aee45f2a07357cbeac37f91dfd98b07b04 Mon Sep 17 00:00:00 2001 From: zachgersh Date: Tue, 4 Jun 2013 00:05:54 -0700 Subject: [PATCH] Broken test committed. Can't find proper directories. --- features/create_sites.feature | 7 +++++++ features/step_definitions/jekyll_steps.rb | 16 ++++++++++++---- features/support/env.rb | 1 + 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/features/create_sites.feature b/features/create_sites.feature index 24e669bc..8d85f084 100644 --- a/features/create_sites.feature +++ b/features/create_sites.feature @@ -3,6 +3,13 @@ Feature: Create sites I want to be able to make a static site In order to share my awesome ideas with the interwebs + 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 + Scenario: Basic site Given I have an "index.html" file that contains "Basic Site" When I run jekyll diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb index 7a1c7cd1..97567255 100644 --- a/features/step_definitions/jekyll_steps.rb +++ b/features/step_definitions/jekyll_steps.rb @@ -4,15 +4,19 @@ Before do Dir.chdir(TEST_DIR) end -After do - Dir.chdir(File.expand_path("..", TEST_DIR)) - FileUtils.rm_rf(TEST_DIR) -end +#After do +# Dir.chdir(File.expand_path("..", TEST_DIR)) +# FileUtils.rm_rf(TEST_DIR) +#end Given /^I have a blank site in "(.*)"$/ do |path| FileUtils.mkdir(path) end +Given /^I do not have a "(.*)" directory$/ do |path| + Dir.exists?("#{TEST_DIR}/#{path}") +end + # Like "I have a foo file" but gives a yaml front matter so jekyll actually processes it Given /^I have an? "(.*)" page(?: with (.*) "(.*)")? that contains "(.*)"$/ do |file, key, value, text| File.open(file, 'w') do |f| @@ -118,6 +122,10 @@ When /^I run jekyll with drafts$/ do run_jekyll(:drafts => true) end +When /^I call jekyll new with test_blank --blank$/ do + call_jekyll_new(:path => "test_blank", :blank => true) +end + When /^I debug jekyll$/ do run_jekyll(:debug => true) end diff --git a/features/support/env.rb b/features/support/env.rb index 6f24647b..efe6b1b6 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -17,6 +17,7 @@ end def call_jekyll_new(opts = {}) command = JEKYLL_PATH.clone command << " new" + command << " #{opts[:path]}" if opts[:path] command << " --blank" if opts[:blank] command << " >> /dev/null 2>&1" if opts[:debug].nil? system command