Skip to content

Commit

Permalink
Fix: replace 2&>1 by 2>&1 (#1932)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrice Duroux <patrice.duroux@gmail.com>
Co-authored-by: Dan Webb <dan.webb@damacus.io>
  • Loading branch information
peutch and damacus committed Dec 18, 2023
1 parent acbcf45 commit 6468bac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/kitchen/driver/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ class Slow < Base
it "run command" do
Kitchen::Driver::Base.any_instance.stubs(:run_command).returns(true)

config[:pre_create_command] = "echo works 2&>1 > /dev/null"
driver.expects(:run_command).with("echo works 2&>1 > /dev/null")
config[:pre_create_command] = "echo works 2>&1 > /dev/null"
driver.expects(:run_command).with("echo works 2>&1 > /dev/null")
driver.send(:pre_create_command)
end

it "error if cannot run" do
class ShellCommandFailed < Kitchen::ShellOut::ShellCommandFailed; end
Kitchen::Driver::Base.any_instance.stubs(:run_command).raises(ShellCommandFailed, "Expected process to exit with [0], but received '1'")

config[:pre_create_command] = "touch /this/dir/does/not/exist 2&>1 > /dev/null"
config[:pre_create_command] = "touch /this/dir/does/not/exist 2>&1 > /dev/null"
_ { driver.send(:pre_create_command) }.must_raise Kitchen::ActionFailed
end
end
Expand Down

0 comments on commit 6468bac

Please sign in to comment.