features/steps/creating_steps.rb in cucumber-nagios-0.8.11 vs features/steps/creating_steps.rb in cucumber-nagios-0.9.0

- old
+ new

@@ -7,19 +7,45 @@ When /^I create a new project called "([^\"]*)"$/ do |project_name| @project_name = project_name FileUtils.rm_rf("/tmp/#{@project_name}") - silent_system("cd /tmp ; cucumber-nagios-gen project #{@project_name}").should be_true + Dir.chdir("/tmp") do + silent_system("cucumber-nagios-gen project #{@project_name}").should be_true + end end +When /^I pretend to create a new project called "([^\"]*)"$/ do |project_name| + @project_name = project_name + FileUtils.rm_rf("/tmp/#{@project_name}") if File.directory?("/tmp/#{@project_name}") + + Dir.chdir("/tmp") do + silent_system("cucumber-nagios-gen project --pretend #{@project_name}").should be_true + end +end + When /^I freeze in dependencies$/ do @project_name.should_not be_nil - silent_system("cd /tmp/#{@project_name} ; bundle install --local").should be_true + Dir.chdir("/tmp/#{@project_name}") do + silent_system("bundle install --local").should be_true + end end +Then /^I do not freeze in dependencies$/ do + @project_name.should_not be_nil + lambda do + Dir.chdir("/tmp/#{@project_name}") do + $stderr.puts "This should not run" + end + end.should raise_error(Errno::ENOENT) +end + Then /^a Gemfile lock should be created$/ do @project_name.should_not be_nil File.exists?("/tmp/#{@project_name}/Gemfile.lock").should be_true end +Then /^a Gemfile lock should not be created$/ do + @project_name.should_not be_nil + File.exists?("/tmp/#{@project_name}/Gemfile.lock").should be_false +end