features/step_definitions/cli_steps.rb in berkshelf-1.4.6 vs features/step_definitions/cli_steps.rb in berkshelf-2.0.0.beta

- old
+ new

@@ -10,21 +10,21 @@ sleep 10 end Then /^a file named "(.*?)" should exist in the current directory$/ do |filename| in_current_dir do - File.exists?(filename).should be_true # not sure why Aruba's + expect(File.exists?(filename)).to be_true # not sure why Aruba's # #check_file_presence # doesn't work here. It # looks in the wrong # directory. end end Then /^the file "(.*?)" should contain in the current directory:$/ do |filename, string| in_current_dir do - File.read(filename).should match(Regexp.new(string)) + expect(File.read(filename)).to match(Regexp.new(string)) end end When /^I run the init command with the cookbook "(.*?)" as the target$/ do |cookbook_name| run_simple(unescape("berks init #{cookbook_name}"), true) @@ -54,9 +54,17 @@ run_simple(unescape("berks upload #{flags.raw.join(" ")}"), false) end When /^I run the cookbook command to create "(.*?)"$/ do |name| run_simple(unescape("berks cookbook #{name}"), false) +end + +When /^I (successfully )?run the apply command on "(.*?)"$/ do |successfully, environment_name| + run_simple(unescape("berks apply #{environment_name}"), !!successfully) +end + +When /^I (successfully )?run the apply command on "(.*?)" with flags:$/ do |successfully, environment_name, flags| + run_simple(unescape("berks apply #{environment_name} #{flags.raw.join(" ")}"), !!successfully) end When /^I run the cookbook command to create "(.*?)" with options:$/ do |name, options| run_simple(unescape("berks cookbook #{name} #{options.raw.join(" ")}")) end