Broken test committed. Can't find proper directories.
This commit is contained in:
parent
7fba828f02
commit
b19997aee4
|
@ -3,6 +3,13 @@ Feature: Create sites
|
||||||
I want to be able to make a static site
|
I want to be able to make a static site
|
||||||
In order to share my awesome ideas with the interwebs
|
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
|
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"
|
||||||
When I run jekyll
|
When I run jekyll
|
||||||
|
|
|
@ -4,15 +4,19 @@ Before do
|
||||||
Dir.chdir(TEST_DIR)
|
Dir.chdir(TEST_DIR)
|
||||||
end
|
end
|
||||||
|
|
||||||
After do
|
#After do
|
||||||
Dir.chdir(File.expand_path("..", TEST_DIR))
|
# Dir.chdir(File.expand_path("..", TEST_DIR))
|
||||||
FileUtils.rm_rf(TEST_DIR)
|
# FileUtils.rm_rf(TEST_DIR)
|
||||||
end
|
#end
|
||||||
|
|
||||||
Given /^I have a blank site in "(.*)"$/ do |path|
|
Given /^I have a blank site in "(.*)"$/ do |path|
|
||||||
FileUtils.mkdir(path)
|
FileUtils.mkdir(path)
|
||||||
end
|
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
|
# 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|
|
Given /^I have an? "(.*)" page(?: with (.*) "(.*)")? that contains "(.*)"$/ do |file, key, value, text|
|
||||||
File.open(file, 'w') do |f|
|
File.open(file, 'w') do |f|
|
||||||
|
@ -118,6 +122,10 @@ When /^I run jekyll with drafts$/ do
|
||||||
run_jekyll(:drafts => true)
|
run_jekyll(:drafts => true)
|
||||||
end
|
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
|
When /^I debug jekyll$/ do
|
||||||
run_jekyll(:debug => true)
|
run_jekyll(:debug => true)
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,6 +17,7 @@ end
|
||||||
def call_jekyll_new(opts = {})
|
def call_jekyll_new(opts = {})
|
||||||
command = JEKYLL_PATH.clone
|
command = JEKYLL_PATH.clone
|
||||||
command << " new"
|
command << " new"
|
||||||
|
command << " #{opts[:path]}" if opts[:path]
|
||||||
command << " --blank" if opts[:blank]
|
command << " --blank" if opts[:blank]
|
||||||
command << " >> /dev/null 2>&1" if opts[:debug].nil?
|
command << " >> /dev/null 2>&1" if opts[:debug].nil?
|
||||||
system command
|
system command
|
||||||
|
|
Loading…
Reference in New Issue