diff options
Diffstat (limited to 'spec/integration')
24 files changed, 198 insertions, 198 deletions
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb index 8f2364d99a..3c4d43aac5 100644 --- a/spec/integration/client/client_spec.rb +++ b/spec/integration/client/client_spec.rb @@ -59,17 +59,17 @@ local_mode true cookbook_path "#{path_to('cookbooks')}" EOM - shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", :cwd => chef_dir) + shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir) end - it "should complete successfully with no other environment variables", :skip => (Chef::Platform.windows?) do + it "should complete successfully with no other environment variables", skip: (Chef::Platform.windows?) do file "config/client.rb", <<EOM local_mode true cookbook_path "#{path_to('cookbooks')}" EOM begin - result = shell_out("env -i #{critical_env_vars} #{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", :cwd => chef_dir) + result = shell_out("env -i #{critical_env_vars} #{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir) result.error! rescue Chef::Log.info "Bare invocation will have the following load-path." @@ -84,29 +84,29 @@ local_mode true cookbook_path "#{path_to('cookbooks')}" EOM - result = shell_out("#{chef_client} --no-listen -c \"#{path_to('config/client.rb')}\" -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} --no-listen -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir) result.error! end it "should be able to node.save with bad utf8 characters in the node data" do file "cookbooks/x/attributes/default.rb", 'default["badutf8"] = "Elan Ruusam\xE4e"' - result = shell_out("#{chef_client} -z -r 'x::default' --disable-config", :cwd => path_to("")) + result = shell_out("#{chef_client} -z -r 'x::default' --disable-config", cwd: path_to("")) result.error! end context "and no config file" do it "should complete with success when cwd is just above cookbooks and paths are not specified" do - result = shell_out("#{chef_client} -z -o 'x::default' --disable-config", :cwd => path_to("")) + result = shell_out("#{chef_client} -z -o 'x::default' --disable-config", cwd: path_to("")) result.error! end it "should complete with success when cwd is below cookbooks and paths are not specified" do - result = shell_out("#{chef_client} -z -o 'x::default' --disable-config", :cwd => path_to("cookbooks/x")) + result = shell_out("#{chef_client} -z -o 'x::default' --disable-config", cwd: path_to("cookbooks/x")) result.error! end it "should fail when cwd is below high above and paths are not specified" do - result = shell_out("#{chef_client} -z -o 'x::default' --disable-config", :cwd => File.expand_path("..", path_to(""))) + result = shell_out("#{chef_client} -z -o 'x::default' --disable-config", cwd: File.expand_path("..", path_to(""))) expect(result.exitstatus).to eq(1) end end @@ -115,7 +115,7 @@ EOM before { file ".chef/knife.rb", "xxx.xxx" } it "should load .chef/knife.rb when -z is specified" do - result = shell_out("#{chef_client} -z -o 'x::default'", :cwd => path_to("")) + result = shell_out("#{chef_client} -z -o 'x::default'", cwd: path_to("")) # FATAL: Configuration error NoMethodError: undefined method `xxx' for nil:NilClass expect(result.stdout).to include("xxx") end @@ -128,7 +128,7 @@ local_mode true cookbook_path "#{path_to('cookbooks')}" EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir) result.error! end @@ -172,7 +172,7 @@ client_key #{path_to('mykey.pem').inspect} cookbook_path #{path_to('cookbooks').inspect} EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir) result.error! end @@ -195,7 +195,7 @@ file #{path_to('tempfile2.txt').inspect} do end EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" #{path_to('arbitrary.rb')} #{path_to('arbitrary2.rb')}", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" #{path_to('arbitrary.rb')} #{path_to('arbitrary2.rb')}", cwd: chef_dir) result.error! expect(IO.read(path_to("tempfile.txt"))).to eq("1") @@ -215,7 +215,7 @@ file #{path_to('tempfile.txt').inspect} do end EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" arbitrary.rb", :cwd => path_to("")) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" arbitrary.rb", cwd: path_to("")) result.error! expect(IO.read(path_to("tempfile.txt"))).to eq("1") @@ -239,7 +239,7 @@ file #{path_to('tempfile.txt').inspect} do end EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o x::constant_definition arbitrary.rb", :cwd => path_to("")) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o x::constant_definition arbitrary.rb", cwd: path_to("")) result.error! expect(IO.read(path_to("tempfile.txt"))).to eq("1") @@ -253,7 +253,7 @@ chef_server_url 'http://omg.com/blah' cookbook_path "#{path_to('cookbooks')}" EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", cwd: chef_dir) result.error! end @@ -263,7 +263,7 @@ chef_server_url 'http://omg.com/blah' cookbook_path "#{path_to('cookbooks')}" EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --local-mode", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --local-mode", cwd: chef_dir) result.error! end @@ -273,7 +273,7 @@ chef_server_url 'http://omg.com/blah' cookbook_path "#{path_to('cookbooks')}" EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --local-mode", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --local-mode", cwd: chef_dir) expect(result.stdout).not_to include("SSL validation of HTTPS requests is disabled.") result.error! end @@ -284,7 +284,7 @@ chef_server_url 'http://omg.com/blah' cookbook_path "#{path_to('cookbooks')}" EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", cwd: chef_dir) result.error! end @@ -294,7 +294,7 @@ chef_server_url 'http://omg.com/blah' cookbook_path "#{path_to('cookbooks')}" EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -r 'x::default' -z -l info", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -r 'x::default' -z -l info", cwd: chef_dir) expect(result.stdout).not_to include("Overridden Run List") expect(result.stdout).to include("Run List is [recipe[x::default]]") result.error! @@ -305,7 +305,7 @@ EOM local_mode true cookbook_path "#{path_to('cookbooks')}" EOM - result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z --profile-ruby", :cwd => chef_dir) + result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z --profile-ruby", cwd: chef_dir) result.error! expect(File.exist?(path_to("config/local-mode-cache/cache/graph_profile.out"))).to be true end @@ -315,7 +315,7 @@ EOM local_mode true cookbook_path "#{path_to('cookbooks')}" EOM - result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", :cwd => chef_dir) + result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", cwd: chef_dir) result.error! expect(File.exist?(path_to("config/local-mode-cache/cache/graph_profile.out"))).to be false end @@ -335,7 +335,7 @@ cookbook_path "#{path_to('cookbooks')}" EOM end it "should fail the chef client run" do - command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", :cwd => chef_dir) + command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir) expect(command.exitstatus).to eql(1) expect(command.stdout).to match(/Chef::Exceptions::CookbookChefVersionMismatch/) end @@ -361,7 +361,7 @@ EOM end it "the cheffish DSL is loaded lazily" do - command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", :cwd => chef_dir) + command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir) expect(command.exitstatus).to eql(0) end end @@ -380,7 +380,7 @@ EOM it "the cheffish DSL tries to load but fails (because chef-provisioning is not there)" do # we'd need to have a custom bundle to fix this that omitted chef-provisioning, but that would dig our crazy even deeper, so lets not skip "but if chef-provisioning is in our bundle or in our gemset then this test, very annoyingly, always fails" - command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", :cwd => chef_dir) + command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir) expect(command.exitstatus).to eql(1) expect(command.stdout).to match(/cannot load such file -- chef\/provisioning/) end @@ -415,7 +415,7 @@ EOM ENV.delete("CHEF_TREAT_DEPRECATION_WARNINGS_AS_ERRORS") - result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", :cwd => chef_dir) + result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir) expect(result.error?).to be_falsey # Search to the end of the client run in the output @@ -446,7 +446,7 @@ control_group "control group without top level control" do end RECIPE - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'audit_test::succeed' -l info", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'audit_test::succeed' -l info", cwd: chef_dir) expect(result.error?).to be_falsey expect(result.stdout).to include("Successfully executed all `control_group` blocks and contained examples") end @@ -460,7 +460,7 @@ control_group "control group without top level control" do end RECIPE - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'audit_test::fail'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'audit_test::fail'", cwd: chef_dir) expect(result.error?).to be_truthy expect(result.stdout).to include("Failure/Error: expect(2 - 2).to eq(1)") end @@ -487,7 +487,7 @@ no_lazy_load #{lazy} local_mode true cookbook_path "#{path_to('cookbooks')}" EOM - result = shell_out("#{chef_client} -l debug -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", :cwd => chef_dir) + result = shell_out("#{chef_client} -l debug -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir) result.error! expect(IO.read(path_to("tempfile.txt")).strip).to eq("this is my file") @@ -522,7 +522,7 @@ EOM end it "should run the ohai plugin" do - result = shell_out("#{chef_client} -l debug -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", :cwd => chef_dir) + result = shell_out("#{chef_client} -l debug -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir) result.error! expect(IO.read(path_to("tempfile.txt"))).to eq("2014") @@ -545,18 +545,18 @@ EOM file "config/client.rb", <<EOM chef_repo_path "#{tmp_dir}" EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --recipe-url=http://localhost:9000/recipes.tgz -o 'x::default' -z", :cwd => tmp_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --recipe-url=http://localhost:9000/recipes.tgz -o 'x::default' -z", cwd: tmp_dir) result.error! end it "should fail when passed --recipe-url and not passed -z" do - result = shell_out("#{chef_client} --recipe-url=http://localhost:9000/recipes.tgz", :cwd => tmp_dir) + result = shell_out("#{chef_client} --recipe-url=http://localhost:9000/recipes.tgz", cwd: tmp_dir) expect(result.exitstatus).not_to eq(0) end it "should fail when passed --recipe-url with a file that doesn't exist" do broken_path = File.join(CHEF_SPEC_DATA, "recipes_dont_exist.tgz") - result = shell_out("#{chef_client} --recipe-url=#{broken_path}", :cwd => tmp_dir) + result = shell_out("#{chef_client} --recipe-url=#{broken_path}", cwd: tmp_dir) expect(result.exitstatus).not_to eq(0) end end @@ -583,12 +583,12 @@ EOM end it "the chef client run should succeed" do - command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", :cwd => chef_dir) + command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir) command.error! end it "a chef-solo run should succeed" do - command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", :cwd => chef_dir) + command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir) command.error! end end @@ -607,25 +607,25 @@ EOM end it "a chef client run should not log to info by default" do - command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", :cwd => chef_dir) + command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir) command.error! expect(command.stdout).not_to include("INFO") end it "a chef client run to a pipe should not log to info by default" do - command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork | tee #{path_to('chefrun.out')}", :cwd => chef_dir) + command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork | tee #{path_to('chefrun.out')}", cwd: chef_dir) command.error! expect(command.stdout).not_to include("INFO") end it "a chef solo run should not log to info by default" do - command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", :cwd => chef_dir) + command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir) command.error! expect(command.stdout).not_to include("INFO") end it "a chef solo run to a pipe should not log to info by default" do - command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork | tee #{path_to('chefrun.out')}", :cwd => chef_dir) + command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork | tee #{path_to('chefrun.out')}", cwd: chef_dir) command.error! expect(command.stdout).not_to include("INFO") end @@ -643,37 +643,37 @@ EOM end it "chef-client runs by default with no supervisor" do - command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", :cwd => chef_dir) + command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir) command.error! expect(command.stdout).to include("NOFORK") end it "chef-solo runs by default with no supervisor" do - command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", :cwd => chef_dir) + command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir) command.error! expect(command.stdout).to include("NOFORK") end it "chef-client --no-fork does not fork" do - command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", :cwd => chef_dir) + command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir) command.error! expect(command.stdout).to include("NOFORK") end it "chef-solo --no-fork does not fork" do - command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", :cwd => chef_dir) + command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir) command.error! expect(command.stdout).to include("NOFORK") end it "chef-client with --fork uses a supervisor" do - command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --fork", :cwd => chef_dir) + command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --fork", cwd: chef_dir) command.error! expect(command.stdout).to include("WITHFORK") end it "chef-solo with --fork uses a supervisor" do - command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --fork", :cwd => chef_dir) + command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --fork", cwd: chef_dir) command.error! expect(command.stdout).to include("WITHFORK") end @@ -692,13 +692,13 @@ EOM end it "chef-client uses a supervisor" do - command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", :cwd => chef_dir) + command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir) command.error! expect(command.stdout).to include("WITHFORK") end it "chef-solo uses a supervisor" do - command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", :cwd => chef_dir) + command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir) command.error! expect(command.stdout).to include("WITHFORK") end @@ -717,13 +717,13 @@ EOM end it "chef-client uses a supervisor" do - command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", :cwd => chef_dir) + command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir) command.error! expect(command.stdout).to include("NOFORK") end it "chef-solo uses a supervisor" do - command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", :cwd => chef_dir) + command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir) command.error! expect(command.stdout).to include("NOFORK") end diff --git a/spec/integration/client/exit_code_spec.rb b/spec/integration/client/exit_code_spec.rb index 4397426723..939f5ad5b7 100644 --- a/spec/integration/client/exit_code_spec.rb +++ b/spec/integration/client/exit_code_spec.rb @@ -44,8 +44,8 @@ EOM def run_chef_client_and_expect_exit_code(exit_code) shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", - :cwd => chef_dir, - :returns => [exit_code]) + cwd: chef_dir, + returns: [exit_code]) end context "has a cookbook" do diff --git a/spec/integration/client/ipv6_spec.rb b/spec/integration/client/ipv6_spec.rb index 6452db1e39..b6e08e842f 100644 --- a/spec/integration/client/ipv6_spec.rb +++ b/spec/integration/client/ipv6_spec.rb @@ -22,7 +22,7 @@ describe "chef-client" do include IntegrationSupport include Chef::Mixin::ShellOut - let(:chef_zero_opts) { { :host => "::1" } } + let(:chef_zero_opts) { { host: "::1" } } let(:validation_pem) do <<-END_VALIDATION_PEM @@ -93,7 +93,7 @@ END_CLIENT_RB end it "should complete with success" do - result = shell_out("#{chef_client_cmd} -o 'noop::default'", :cwd => chef_dir) + result = shell_out("#{chef_client_cmd} -o 'noop::default'", cwd: chef_dir) result.error! end @@ -125,7 +125,7 @@ END_CLIENT_RB end it "should complete with success" do - result = shell_out("#{chef_client_cmd} -o 'api-smoke-test::default'", :cwd => chef_dir) + result = shell_out("#{chef_client_cmd} -o 'api-smoke-test::default'", cwd: chef_dir) result.error! end diff --git a/spec/integration/knife/chef_fs_data_store_spec.rb b/spec/integration/knife/chef_fs_data_store_spec.rb index 02508b799d..1e9d1c65b4 100644 --- a/spec/integration/knife/chef_fs_data_store_spec.rb +++ b/spec/integration/knife/chef_fs_data_store_spec.rb @@ -190,7 +190,7 @@ EOM end it "knife cookbook upload works" do - knife("cookbook upload -z --cookbook-path #{path_to('cookbooks_to_upload')} x").should_succeed :stderr => <<EOM + knife("cookbook upload -z --cookbook-path #{path_to('cookbooks_to_upload')} x").should_succeed stderr: <<EOM Uploading x [1.0.0] Uploaded 1 cookbook. EOM @@ -218,7 +218,7 @@ EOM knife("list --local /roles").should_succeed "/roles/x.json\n" end - it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty", :skip => (RUBY_VERSION < "1.9") do + it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty", skip: (RUBY_VERSION < "1.9") do knife("raw -z -i #{path_to('rolestuff.json')} -m PUT /roles/x").should_succeed( /"x"/ ) expect(IO.read(path_to("roles/x.json"))).to eq <<EOM.strip { @@ -247,7 +247,7 @@ EOM end it "knife cookbook upload works" do - knife("cookbook upload -z --cookbook-path #{path_to('cookbooks_to_upload')} z").should_succeed :stderr => <<EOM + knife("cookbook upload -z --cookbook-path #{path_to('cookbooks_to_upload')} z").should_succeed stderr: <<EOM Uploading z [1.0.0] Uploaded 1 cookbook. EOM @@ -281,7 +281,7 @@ EOM knife("list --local /roles").should_succeed "/roles/z.json\n" end - it "After knife raw -z -i rolestuff.json -m POST /roles, the output is pretty", :skip => (RUBY_VERSION < "1.9") do + it "After knife raw -z -i rolestuff.json -m POST /roles, the output is pretty", skip: (RUBY_VERSION < "1.9") do knife("raw -z -i #{path_to('rolestuff.json')} -m POST /roles").should_succeed( /uri/ ) expect(IO.read(path_to("roles/x.json"))).to eq <<EOM.strip { @@ -489,7 +489,7 @@ EOM knife("list --local /users").should_succeed "/users/x.json\n" end - it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty", :skip => (RUBY_VERSION < "1.9") do + it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty", skip: (RUBY_VERSION < "1.9") do knife("raw -z -i #{path_to('rolestuff.json')} -m PUT /roles/x").should_succeed( /"x"/ ) expect(IO.read(path_to("roles/x.json"))).to eq <<EOM.strip { diff --git a/spec/integration/knife/chef_repo_path_spec.rb b/spec/integration/knife/chef_repo_path_spec.rb index e609fa60b3..9cb093c178 100644 --- a/spec/integration/knife/chef_repo_path_spec.rb +++ b/spec/integration/knife/chef_repo_path_spec.rb @@ -391,7 +391,7 @@ EOM file "cookbooks2/blah/metadata.rb", "" end it "knife list -Rfp cookbooks shows files in blah" do - knife("list --local -Rfp /cookbooks").should_succeed(<<EOM, :stderr => "WARN: Cookbook 'blah' is empty or entirely chefignored at #{Chef::Config.cookbook_path[0]}/blah\n") + knife("list --local -Rfp /cookbooks").should_succeed(<<EOM, stderr: "WARN: Cookbook 'blah' is empty or entirely chefignored at #{Chef::Config.cookbook_path[0]}/blah\n") /cookbooks/blah/ /cookbooks/blah/metadata.rb /cookbooks/cookbook1/ @@ -408,7 +408,7 @@ EOM file "cookbooks2/blah/metadata.rb", "" end it "knife list -Rfp cookbooks shows files in the first cookbook and not the second" do - knife("list --local -Rfp /cookbooks").should_succeed(<<EOM, :stderr => "WARN: Child with name 'blah' found in multiple directories: #{Chef::Config.cookbook_path[0]}/blah and #{Chef::Config.cookbook_path[1]}/blah\n") + knife("list --local -Rfp /cookbooks").should_succeed(<<EOM, stderr: "WARN: Child with name 'blah' found in multiple directories: #{Chef::Config.cookbook_path[0]}/blah and #{Chef::Config.cookbook_path[1]}/blah\n") /cookbooks/blah/ /cookbooks/blah/metadata.json /cookbooks/cookbook1/ @@ -442,7 +442,7 @@ EOM file "data_bags2/blah/item2.json", "" end it "knife list -Rfp data_bags shows only items in data_bags1" do - knife("list --local -Rfp /data_bags").should_succeed(<<EOM, :stderr => "WARN: Child with name 'blah' found in multiple directories: #{Chef::Config.data_bag_path[0]}/blah and #{Chef::Config.data_bag_path[1]}/blah\n") + knife("list --local -Rfp /data_bags").should_succeed(<<EOM, stderr: "WARN: Child with name 'blah' found in multiple directories: #{Chef::Config.data_bag_path[0]}/blah and #{Chef::Config.data_bag_path[1]}/blah\n") /data_bags/bag/ /data_bags/bag/item.json /data_bags/bag2/ diff --git a/spec/integration/knife/chef_repository_file_system_spec.rb b/spec/integration/knife/chef_repository_file_system_spec.rb index 222d3aee8a..c9aa787bbe 100644 --- a/spec/integration/knife/chef_repository_file_system_spec.rb +++ b/spec/integration/knife/chef_repository_file_system_spec.rb @@ -53,7 +53,7 @@ EOM before { directory "cookbooks/cookbook1" } it "knife list --local -Rfp / does not return it" do - knife("list --local -Rfp /").should_succeed(<<EOM, :stderr => "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n") + knife("list --local -Rfp /").should_succeed(<<EOM, stderr: "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n") /cookbooks/ EOM end @@ -63,7 +63,7 @@ EOM before { directory "cookbooks/cookbook1/recipes" } it "knife list --local -Rfp / does not return it" do - knife("list --local -Rfp /").should_succeed(<<EOM, :stderr => "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n") + knife("list --local -Rfp /").should_succeed(<<EOM, stderr: "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n") /cookbooks/ EOM end @@ -90,7 +90,7 @@ EOM before { directory "cookbooks/cookbook1/templates/default" } it "knife list --local -Rfp / does not return it" do - knife("list --local -Rfp /").should_succeed(<<EOM, :stderr => "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n") + knife("list --local -Rfp /").should_succeed(<<EOM, stderr: "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n") /cookbooks/ EOM end diff --git a/spec/integration/knife/chefignore_spec.rb b/spec/integration/knife/chefignore_spec.rb index aa5a3979cc..e3f1e18f7e 100644 --- a/spec/integration/knife/chefignore_spec.rb +++ b/spec/integration/knife/chefignore_spec.rb @@ -69,7 +69,7 @@ EOM end it "the cookbook is not listed" do - knife("list --local -Rfp /").should_succeed(<<EOM, :stderr => "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n") + knife("list --local -Rfp /").should_succeed(<<EOM, stderr: "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n") /cookbooks/ EOM end @@ -251,7 +251,7 @@ EOM end it "chefignores apply only to the winning cookbook" do - knife("list --local -Rfp /").should_succeed(<<EOM, :stderr => "WARN: Child with name 'yourcookbook' found in multiple directories: #{Chef::Config.chef_repo_path}/cookbooks1/yourcookbook and #{Chef::Config.chef_repo_path}/cookbooks2/yourcookbook\n") + knife("list --local -Rfp /").should_succeed(<<EOM, stderr: "WARN: Child with name 'yourcookbook' found in multiple directories: #{Chef::Config.chef_repo_path}/cookbooks1/yourcookbook and #{Chef::Config.chef_repo_path}/cookbooks2/yourcookbook\n") /cookbooks/ /cookbooks/mycookbook/ /cookbooks/mycookbook/x.json diff --git a/spec/integration/knife/common_options_spec.rb b/spec/integration/knife/common_options_spec.rb index da1409456b..0b090f170e 100644 --- a/spec/integration/knife/common_options_spec.rb +++ b/spec/integration/knife/common_options_spec.rb @@ -125,7 +125,7 @@ EOM context "when the default port (8889) is already bound" do before :each do begin - @server = ChefZero::Server.new(:host => "localhost", :port => 8889) + @server = ChefZero::Server.new(host: "localhost", port: 8889) @server.start_background rescue Errno::EADDRINUSE # OK. Don't care who has it in use, as long as *someone* does. @@ -144,7 +144,7 @@ EOM context "when port 9999 is already bound" do before :each do begin - @server = ChefZero::Server.new(:host => "localhost", :port => 9999) + @server = ChefZero::Server.new(host: "localhost", port: 9999) @server.start_background rescue Errno::EADDRINUSE # OK. Don't care who has it in use, as long as *someone* does. diff --git a/spec/integration/knife/cookbook_api_ipv6_spec.rb b/spec/integration/knife/cookbook_api_ipv6_spec.rb index 0a4a6a6e94..434210c01e 100644 --- a/spec/integration/knife/cookbook_api_ipv6_spec.rb +++ b/spec/integration/knife/cookbook_api_ipv6_spec.rb @@ -23,7 +23,7 @@ describe "Knife cookbook API integration with IPv6", :workstation, :not_supporte include Chef::Mixin::ShellOut when_the_chef_server "is bound to IPv6" do - let(:chef_zero_opts) { { :host => "::1" } } + let(:chef_zero_opts) { { host: "::1" } } let(:client_key) do <<-END_VALIDATION_PEM @@ -89,7 +89,7 @@ END_CLIENT_RB end it "successfully uploads a cookbook" do - shell_out!("#{knife} cookbook upload apache2 #{knife_config_flag}", :cwd => chef_dir) + shell_out!("#{knife} cookbook upload apache2 #{knife_config_flag}", cwd: chef_dir) versions_list_json = Chef::HTTP::Simple.new("http://[::1]:8900").get("/cookbooks/apache2", "accept" => "application/json") versions_list = Chef::JSONCompat.from_json(versions_list_json) expect(versions_list["apache2"]["versions"]).not_to be_empty @@ -97,11 +97,11 @@ END_CLIENT_RB context "and the cookbook has been uploaded to the server" do before do - shell_out!("#{knife} cookbook upload apache2 #{knife_config_flag}", :cwd => chef_dir) + shell_out!("#{knife} cookbook upload apache2 #{knife_config_flag}", cwd: chef_dir) end it "downloads the cookbook" do - shell_out!("knife cookbook download apache2 #{knife_config_flag} -d #{cache_path}", :cwd => chef_dir) + shell_out!("knife cookbook download apache2 #{knife_config_flag} -d #{cache_path}", cwd: chef_dir) expect(Dir["#{cache_path}/*"].map { |entry| File.basename(entry) }).to include("apache2-0.0.1") end end diff --git a/spec/integration/knife/delete_spec.rb b/spec/integration/knife/delete_spec.rb index 1c69fbf9c9..9e0b46fd81 100644 --- a/spec/integration/knife/delete_spec.rb +++ b/spec/integration/knife/delete_spec.rb @@ -413,7 +413,7 @@ EOM end it "knife delete --both /environments/_default.json fails but still deletes the local copy" do - knife("delete --both /environments/_default.json").should_fail :stderr => "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n", :stdout => "Deleted /environments/_default.json\n" + knife("delete --both /environments/_default.json").should_fail stderr: "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n", stdout: "Deleted /environments/_default.json\n" knife("list -Rf /").should_succeed server_everything knife("list -Rf --local /").should_succeed <<EOM /clients @@ -600,7 +600,7 @@ EOM end it "knife delete --both /environments/_default.json fails" do - knife("delete --both /environments/_default.json").should_fail "", :stderr => "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n" + knife("delete --both /environments/_default.json").should_fail "", stderr: "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n" knife("list -Rf /").should_succeed server_everything knife("list -Rf --local /").should_succeed nothing end @@ -643,7 +643,7 @@ EOM context "and cwd is at the top level" do before { cwd "." } it "knife delete fails" do - knife("delete").should_fail "FATAL: You must specify at least one argument. If you want to delete everything in this directory, run \"knife delete --recurse .\"\n", :stdout => /USAGE/ + knife("delete").should_fail "FATAL: You must specify at least one argument. If you want to delete everything in this directory, run \"knife delete --recurse .\"\n", stdout: /USAGE/ knife("list -Rf /").should_succeed <<EOM clients clients/chef-validator.json @@ -796,7 +796,7 @@ EOM end it "knife delete --both /environments/_default.json fails but still deletes the local copy" do - knife("delete --both /environments/_default.json").should_fail :stderr => "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n", :stdout => "Deleted /environments/_default.json\n" + knife("delete --both /environments/_default.json").should_fail stderr: "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n", stdout: "Deleted /environments/_default.json\n" knife("list -Rf /").should_succeed server_nothing knife("list -Rf --local /").should_succeed <<EOM /clients @@ -856,7 +856,7 @@ EOM context "and cwd is at the top level" do before { cwd "." } it "knife delete fails" do - knife("delete").should_fail "FATAL: You must specify at least one argument. If you want to delete everything in this directory, run \"knife delete --recurse .\"\n", :stdout => /USAGE/ + knife("delete").should_fail "FATAL: You must specify at least one argument. If you want to delete everything in this directory, run \"knife delete --recurse .\"\n", stdout: /USAGE/ knife("list -Rf /").should_succeed <<EOM clients clients/chef-validator.json @@ -962,7 +962,7 @@ EOM end end - when_the_chef_server "is in Enterprise mode", :osc_compat => false, :single_org => false do + when_the_chef_server "is in Enterprise mode", osc_compat: false, single_org: false do before do organization "foo" do container "x", {} diff --git a/spec/integration/knife/deps_spec.rb b/spec/integration/knife/deps_spec.rb index 3f200396ba..b8ab6e719c 100644 --- a/spec/integration/knife/deps_spec.rb +++ b/spec/integration/knife/deps_spec.rb @@ -252,44 +252,44 @@ EOM when_the_repository "is empty" do it "knife deps /blah reports an error" do knife("deps /blah").should_fail( - :exit_code => 2, - :stdout => "/blah\n", - :stderr => "ERROR: /blah: No such file or directory\n" + exit_code: 2, + stdout: "/blah\n", + stderr: "ERROR: /blah: No such file or directory\n" ) end it "knife deps /roles/x.json reports an error" do knife("deps /roles/x.json").should_fail( - :exit_code => 2, - :stdout => "/roles/x.json\n", - :stderr => "ERROR: /roles/x.json: No such file or directory\n" + exit_code: 2, + stdout: "/roles/x.json\n", + stderr: "ERROR: /roles/x.json: No such file or directory\n" ) end it "knife deps /nodes/x.json reports an error" do knife("deps /nodes/x.json").should_fail( - :exit_code => 2, - :stdout => "/nodes/x.json\n", - :stderr => "ERROR: /nodes/x.json: No such file or directory\n" + exit_code: 2, + stdout: "/nodes/x.json\n", + stderr: "ERROR: /nodes/x.json: No such file or directory\n" ) end it "knife deps /environments/x.json reports an error" do knife("deps /environments/x.json").should_fail( - :exit_code => 2, - :stdout => "/environments/x.json\n", - :stderr => "ERROR: /environments/x.json: No such file or directory\n" + exit_code: 2, + stdout: "/environments/x.json\n", + stderr: "ERROR: /environments/x.json: No such file or directory\n" ) end it "knife deps /cookbooks/x reports an error" do knife("deps /cookbooks/x").should_fail( - :exit_code => 2, - :stdout => "/cookbooks/x\n", - :stderr => "ERROR: /cookbooks/x: No such file or directory\n" + exit_code: 2, + stdout: "/cookbooks/x\n", + stderr: "ERROR: /cookbooks/x: No such file or directory\n" ) end it "knife deps /data_bags/bag/item.json reports an error" do knife("deps /data_bags/bag/item.json").should_fail( - :exit_code => 2, - :stdout => "/data_bags/bag/item.json\n", - :stderr => "ERROR: /data_bags/bag/item.json: No such file or directory\n" + exit_code: 2, + stdout: "/data_bags/bag/item.json\n", + stderr: "ERROR: /data_bags/bag/item.json: No such file or directory\n" ) end end @@ -299,9 +299,9 @@ EOM end it "knife deps reports the cookbook, along with an error" do knife("deps /roles/starring.json").should_fail( - :exit_code => 2, - :stdout => "/cookbooks/quiche\n/roles/starring.json\n", - :stderr => "ERROR: /cookbooks/quiche: No such file or directory\n" + exit_code: 2, + stdout: "/cookbooks/quiche\n/roles/starring.json\n", + stderr: "ERROR: /cookbooks/quiche: No such file or directory\n" ) end end @@ -311,9 +311,9 @@ EOM end it "knife deps reports the environment, along with an error" do knife("deps /nodes/mort.json").should_fail( - :exit_code => 2, - :stdout => "/environments/desert.json\n/nodes/mort.json\n", - :stderr => "ERROR: /environments/desert.json: No such file or directory\n" + exit_code: 2, + stdout: "/environments/desert.json\n/nodes/mort.json\n", + stderr: "ERROR: /environments/desert.json: No such file or directory\n" ) end end @@ -323,9 +323,9 @@ EOM end it "knife deps reports the role, along with an error" do knife("deps /roles/starring.json").should_fail( - :exit_code => 2, - :stdout => "/roles/minor.json\n/roles/starring.json\n", - :stderr => "ERROR: /roles/minor.json: No such file or directory\n" + exit_code: 2, + stdout: "/roles/minor.json\n/roles/starring.json\n", + stderr: "ERROR: /roles/minor.json: No such file or directory\n" ) end end @@ -337,9 +337,9 @@ EOM end it "knife deps /roles reports an error" do knife("deps /roles").should_fail( - :exit_code => 2, - :stderr => "ERROR: /roles: No such file or directory\n", - :stdout => "/roles\n" + exit_code: 2, + stderr: "ERROR: /roles: No such file or directory\n", + stdout: "/roles\n" ) end end @@ -590,44 +590,44 @@ EOM when_the_chef_server "is empty" do it "knife deps /blah reports an error" do knife("deps --remote /blah").should_fail( - :exit_code => 2, - :stdout => "/blah\n", - :stderr => "ERROR: /blah: No such file or directory\n" + exit_code: 2, + stdout: "/blah\n", + stderr: "ERROR: /blah: No such file or directory\n" ) end it "knife deps /roles/x.json reports an error" do knife("deps --remote /roles/x.json").should_fail( - :exit_code => 2, - :stdout => "/roles/x.json\n", - :stderr => "ERROR: /roles/x.json: No such file or directory\n" + exit_code: 2, + stdout: "/roles/x.json\n", + stderr: "ERROR: /roles/x.json: No such file or directory\n" ) end it "knife deps /nodes/x.json reports an error" do knife("deps --remote /nodes/x.json").should_fail( - :exit_code => 2, - :stdout => "/nodes/x.json\n", - :stderr => "ERROR: /nodes/x.json: No such file or directory\n" + exit_code: 2, + stdout: "/nodes/x.json\n", + stderr: "ERROR: /nodes/x.json: No such file or directory\n" ) end it "knife deps /environments/x.json reports an error" do knife("deps --remote /environments/x.json").should_fail( - :exit_code => 2, - :stdout => "/environments/x.json\n", - :stderr => "ERROR: /environments/x.json: No such file or directory\n" + exit_code: 2, + stdout: "/environments/x.json\n", + stderr: "ERROR: /environments/x.json: No such file or directory\n" ) end it "knife deps /cookbooks/x reports an error" do knife("deps --remote /cookbooks/x").should_fail( - :exit_code => 2, - :stdout => "/cookbooks/x\n", - :stderr => "ERROR: /cookbooks/x: No such file or directory\n" + exit_code: 2, + stdout: "/cookbooks/x\n", + stderr: "ERROR: /cookbooks/x: No such file or directory\n" ) end it "knife deps /data_bags/bag/item reports an error" do knife("deps --remote /data_bags/bag/item.json").should_fail( - :exit_code => 2, - :stdout => "/data_bags/bag/item.json\n", - :stderr => "ERROR: /data_bags/bag/item.json: No such file or directory\n" + exit_code: 2, + stdout: "/data_bags/bag/item.json\n", + stderr: "ERROR: /data_bags/bag/item.json: No such file or directory\n" ) end end @@ -637,9 +637,9 @@ EOM end it "knife deps reports the cookbook, along with an error" do knife("deps --remote /roles/starring.json").should_fail( - :exit_code => 2, - :stdout => "/cookbooks/quiche\n/roles/starring.json\n", - :stderr => "ERROR: /cookbooks/quiche: No such file or directory\n" + exit_code: 2, + stdout: "/cookbooks/quiche\n/roles/starring.json\n", + stderr: "ERROR: /cookbooks/quiche: No such file or directory\n" ) end end @@ -649,9 +649,9 @@ EOM end it "knife deps reports the environment, along with an error" do knife("deps --remote /nodes/mort.json").should_fail( - :exit_code => 2, - :stdout => "/environments/desert.json\n/nodes/mort.json\n", - :stderr => "ERROR: /environments/desert.json: No such file or directory\n" + exit_code: 2, + stdout: "/environments/desert.json\n/nodes/mort.json\n", + stderr: "ERROR: /environments/desert.json: No such file or directory\n" ) end end @@ -661,9 +661,9 @@ EOM end it "knife deps reports the role, along with an error" do knife("deps --remote /roles/starring.json").should_fail( - :exit_code => 2, - :stdout => "/roles/minor.json\n/roles/starring.json\n", - :stderr => "ERROR: /roles/minor.json: No such file or directory\n" + exit_code: 2, + stdout: "/roles/minor.json\n/roles/starring.json\n", + stderr: "ERROR: /roles/minor.json: No such file or directory\n" ) end end diff --git a/spec/integration/knife/diff_spec.rb b/spec/integration/knife/diff_spec.rb index b3bd23f48e..839dcafe49 100644 --- a/spec/integration/knife/diff_spec.rb +++ b/spec/integration/knife/diff_spec.rb @@ -247,7 +247,7 @@ EOM end when_the_chef_server "has an environment with a different value" do before { environment "x", { "description" => "hi" } } - it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do + it "knife diff reports the difference", skip: (RUBY_VERSION < "1.9") do knife("diff /environments/x.json").should_succeed(/ { - "name": "x", @@ -277,7 +277,7 @@ EOM environment "x", {} end - it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do + it "knife diff reports the difference", skip: (RUBY_VERSION < "1.9") do knife("diff /environments/x.json").should_succeed(/ { - "name": "x" @@ -291,7 +291,7 @@ EOM before do environment "x", { "description" => "lo" } end - it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do + it "knife diff reports the difference", skip: (RUBY_VERSION < "1.9") do knife("diff /environments/x.json").should_succeed(/ { "name": "x", @@ -311,7 +311,7 @@ EOM it "knife diff reports an error and does a textual diff" do error_text = "WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error: premature EOF" error_match = Regexp.new(Regexp.escape(error_text)) - knife("diff /environments/x.json").should_succeed(/- "name": "x"/, :stderr => error_match) + knife("diff /environments/x.json").should_succeed(/- "name": "x"/, stderr: error_match) end end end @@ -533,7 +533,7 @@ EOM end when_the_chef_server "has an environment with a different value" do before { environment "x", { "description" => "hi" } } - it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do + it "knife diff reports the difference", skip: (RUBY_VERSION < "1.9") do knife("diff /environments/x.json").should_succeed(/ { - "name": "x", @@ -560,7 +560,7 @@ EOM end when_the_chef_server "has an environment with no value" do before { environment "x", {} } - it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do + it "knife diff reports the difference", skip: (RUBY_VERSION < "1.9") do knife("diff /environments/x.json").should_succeed(/ { - "name": "x" @@ -574,7 +574,7 @@ EOM before do environment "x", { "description" => "lo" } end - it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do + it "knife diff reports the difference", skip: (RUBY_VERSION < "1.9") do knife("diff /environments/x.json").should_succeed(/ { "name": "x", @@ -594,7 +594,7 @@ EOM it "knife diff reports an error and does a textual diff" do error_text = "WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error: premature EOF" error_match = Regexp.new(Regexp.escape(error_text)) - knife("diff /environments/x.json").should_succeed(/- "name": "x"/, :stderr => error_match) + knife("diff /environments/x.json").should_succeed(/- "name": "x"/, stderr: error_match) end end end diff --git a/spec/integration/knife/download_spec.rb b/spec/integration/knife/download_spec.rb index be0fc9d708..68762ec58e 100644 --- a/spec/integration/knife/download_spec.rb +++ b/spec/integration/knife/download_spec.rb @@ -255,7 +255,7 @@ EOM end it "knife download with no parameters reports an error" do - knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", :stdout => /USAGE/ + knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", stdout: /USAGE/ end end end @@ -383,7 +383,7 @@ EOM cwd "data_bags" end it "knife download fails" do - knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", :stdout => /USAGE/ + knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", stdout: /USAGE/ end it "knife download --purge . downloads everything" do knife("download --purge .").should_succeed <<EOM @@ -545,7 +545,7 @@ EOM end it "knife download refuses to change the role" do - knife("download /roles/x.json").should_succeed "", :stderr => "WARNING: /roles/x.rb cannot be updated (can't safely update ruby files).\n" + knife("download /roles/x.json").should_succeed "", stderr: "WARNING: /roles/x.rb cannot be updated (can't safely update ruby files).\n" knife("diff --name-status /roles/x.json").should_succeed "M\t/roles/x.rb\n" end end @@ -566,7 +566,7 @@ WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error (right here) ------^ EOH - knife("download /environments/x.json").should_succeed "Updated /environments/x.json\n", :stderr => warning + knife("download /environments/x.json").should_succeed "Updated /environments/x.json\n", stderr: warning knife("diff --name-status /environments/x.json").should_succeed "" end end @@ -779,7 +779,7 @@ EOM cwd "." end it "knife download with no parameters reports an error" do - knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", :stdout => /USAGE/ + knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", stdout: /USAGE/ end end end @@ -898,7 +898,7 @@ EOM cwd "data_bags" end it "knife download fails" do - knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", :stdout => /USAGE/ + knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", stdout: /USAGE/ end it "knife download --purge . downloads everything" do knife("download --purge .").should_succeed <<EOM @@ -1111,7 +1111,7 @@ EOM end end - when_the_chef_server "is in Enterprise mode", :osc_compat => false, :single_org => false do + when_the_chef_server "is in Enterprise mode", osc_compat: false, single_org: false do before do user "foo", {} user "bar", {} diff --git a/spec/integration/knife/list_spec.rb b/spec/integration/knife/list_spec.rb index 4aa74f3f0e..bcafd40e9b 100644 --- a/spec/integration/knife/list_spec.rb +++ b/spec/integration/knife/list_spec.rb @@ -466,7 +466,7 @@ EOM end end - when_the_repository "has a cookbooks directory and a symlinked cookbooks directory", :skip => (Chef::Platform.windows?) do + when_the_repository "has a cookbooks directory and a symlinked cookbooks directory", skip: (Chef::Platform.windows?) do before do directory "cookbooks" symlink "symlinked", "cookbooks" @@ -503,7 +503,7 @@ EOM end end - when_the_repository "has a real_cookbooks directory and a cookbooks symlink to it", :skip => (Chef::Platform.windows?) do + when_the_repository "has a real_cookbooks directory and a cookbooks symlink to it", skip: (Chef::Platform.windows?) do before do directory "real_cookbooks" symlink "cookbooks", "real_cookbooks" @@ -638,7 +638,7 @@ EOM end end - when_the_chef_server "is in Enterprise mode", :osc_compat => false, :single_org => false do + when_the_chef_server "is in Enterprise mode", osc_compat: false, single_org: false do before do organization "foo" end diff --git a/spec/integration/knife/raw_spec.rb b/spec/integration/knife/raw_spec.rb index 5e0d3a3d11..27e425717b 100644 --- a/spec/integration/knife/raw_spec.rb +++ b/spec/integration/knife/raw_spec.rb @@ -38,7 +38,7 @@ describe "knife raw", :workstation do user "x", "{}" end - it "knife raw /nodes/x returns the node", :skip => (RUBY_VERSION < "1.9") do + it "knife raw /nodes/x returns the node", skip: (RUBY_VERSION < "1.9") do knife("raw /nodes/x").should_succeed <<EOM { "name": "x", @@ -70,7 +70,7 @@ EOM knife("raw /blarghle").should_fail(/ERROR: Server responded with error 404 "Not Found\s*"/) end - it "knife raw -m DELETE /roles/x succeeds", :skip => (RUBY_VERSION < "1.9") do + it "knife raw -m DELETE /roles/x succeeds", skip: (RUBY_VERSION < "1.9") do knife("raw -m DELETE /roles/x").should_succeed <<EOM { "name": "x", @@ -94,7 +94,7 @@ EOM knife("show /roles/x.json").should_fail "ERROR: /roles/x.json: No such file or directory\n" end - it "knife raw -m PUT -i blah.txt /roles/x succeeds", :skip => (RUBY_VERSION < "1.9") do + it "knife raw -m PUT -i blah.txt /roles/x succeeds", skip: (RUBY_VERSION < "1.9") do Tempfile.open("raw_put_input") do |file| file.write <<EOM { @@ -148,7 +148,7 @@ EOM end end - it "knife raw -m POST -i blah.txt /roles succeeds", :skip => (RUBY_VERSION < "1.9") do + it "knife raw -m POST -i blah.txt /roles succeeds", skip: (RUBY_VERSION < "1.9") do Tempfile.open("raw_put_input") do |file| file.write <<EOM { @@ -198,7 +198,7 @@ EOM @raw_server_thread.kill if @raw_server_thread end - it "knife raw /blah returns the prettified json", :skip => (RUBY_VERSION < "1.9") do + it "knife raw /blah returns the prettified json", skip: (RUBY_VERSION < "1.9") do knife("raw /blah").should_succeed <<EOM { "x": "y", diff --git a/spec/integration/knife/show_spec.rb b/spec/integration/knife/show_spec.rb index ed4802fef9..3d7dfe68e2 100644 --- a/spec/integration/knife/show_spec.rb +++ b/spec/integration/knife/show_spec.rb @@ -76,7 +76,7 @@ EOM } EOM end - it "knife show /environments/x.json shows the remote version", :skip => (RUBY_VERSION < "1.9") do + it "knife show /environments/x.json shows the remote version", skip: (RUBY_VERSION < "1.9") do knife("show /environments/x.json").should_succeed <<EOM /environments/x.json: { @@ -92,7 +92,7 @@ EOM } EOM end - it "knife show /roles/x.json shows the remote version", :skip => (RUBY_VERSION < "1.9") do + it "knife show /roles/x.json shows the remote version", skip: (RUBY_VERSION < "1.9") do knife("show /roles/x.json").should_succeed <<EOM /roles/x.json: { @@ -135,7 +135,7 @@ EOM "name" => "x", } end - it "knife show shows the attributes in a predetermined order", :skip => (RUBY_VERSION < "1.9") do + it "knife show shows the attributes in a predetermined order", skip: (RUBY_VERSION < "1.9") do knife("show /environments/x.json").should_succeed <<EOM /environments/x.json: { diff --git a/spec/integration/knife/upload_spec.rb b/spec/integration/knife/upload_spec.rb index dc713d02b3..f478e6da01 100644 --- a/spec/integration/knife/upload_spec.rb +++ b/spec/integration/knife/upload_spec.rb @@ -68,7 +68,7 @@ EOM end it "knife upload --purge deletes everything" do - knife("upload --purge /").should_succeed(<<EOM, :stderr => "WARNING: /environments/_default.json cannot be deleted (default environment cannot be modified).\n") + knife("upload --purge /").should_succeed(<<EOM, stderr: "WARNING: /environments/_default.json cannot be deleted (default environment cannot be modified).\n") Deleted extra entry /clients/chef-validator.json (purge is on) Deleted extra entry /clients/chef-webui.json (purge is on) Deleted extra entry /clients/x.json (purge is on) @@ -271,7 +271,7 @@ EOM end it "knife upload with no parameters reports an error" do - knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", :stdout => /USAGE/ + knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", stdout: /USAGE/ end end end @@ -291,7 +291,7 @@ Created /data_bags/x/y.json EOM knife("diff --name-status /data_bags").should_succeed <<EOM EOM - expect(Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, :create_additions => false).keys.sort).to eq(%w{foo id}) + expect(Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, create_additions: false).keys.sort).to eq(%w{foo id}) end it "knife upload /data_bags/x /data_bags/x/y.json uploads x once" do @@ -314,7 +314,7 @@ Created /data_bags/x Created /data_bags/x/y.json EOM knife("diff --name-status /data_bags").should_succeed "" - result = Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, :create_additions => false) + result = Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, create_additions: false) expect(result.keys.sort).to eq(%w{chef_type data_bag id}) expect(result["chef_type"]).to eq("aaa") expect(result["data_bag"]).to eq("bbb") @@ -419,7 +419,7 @@ EOM end it "knife upload fails" do - knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", :stdout => /USAGE/ + knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", stdout: /USAGE/ end it "knife upload --purge . uploads everything" do @@ -525,7 +525,7 @@ EOM when_the_chef_server "has a frozen cookbook" do before do - cookbook "frozencook", "1.0.0", {}, :frozen => true + cookbook "frozencook", "1.0.0", {}, frozen: true end when_the_repository "has an update to said cookbook" do @@ -652,7 +652,7 @@ WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error EOH knife("upload /environments/x.json").should_fail(error1) - knife("diff --name-status /environments/x.json").should_succeed("M\t/environments/x.json\n", :stderr => warn) + knife("diff --name-status /environments/x.json").should_succeed("M\t/environments/x.json\n", stderr: warn) end end @@ -767,7 +767,7 @@ EOM end it "knife upload --purge deletes everything" do - knife("upload --purge /").should_succeed(<<EOM, :stderr => "WARNING: /environments/_default.json cannot be deleted (default environment cannot be modified).\n") + knife("upload --purge /").should_succeed(<<EOM, stderr: "WARNING: /environments/_default.json cannot be deleted (default environment cannot be modified).\n") Deleted extra entry /clients/chef-validator.json (purge is on) Deleted extra entry /clients/chef-webui.json (purge is on) Deleted extra entry /clients/x.json (purge is on) @@ -922,7 +922,7 @@ EOM cwd "." end it "knife upload with no parameters reports an error" do - knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", :stdout => /USAGE/ + knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", stdout: /USAGE/ end end end @@ -1024,7 +1024,7 @@ EOM cwd "data_bags" end it "knife upload fails" do - knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", :stdout => /USAGE/ + knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", stdout: /USAGE/ end it "knife upload --purge . uploads everything" do knife("upload --purge .").should_succeed <<EOM @@ -1274,7 +1274,7 @@ EOM end end - when_the_chef_server "is in Enterprise mode", :osc_compat => false, :single_org => false do + when_the_chef_server "is in Enterprise mode", osc_compat: false, single_org: false do before do user "foo", {} user "bar", {} @@ -1472,7 +1472,7 @@ EOM end it "knife upload / emits a warning for bar and invites foobar" do - knife("upload /").should_succeed "Updated /invitations.json\n", :stderr => "WARN: Could not invite bar to organization foo: User bar is already in organization foo\n" + knife("upload /").should_succeed "Updated /invitations.json\n", stderr: "WARN: Could not invite bar to organization foo: User bar is already in organization foo\n" expect(api.get("association_requests").map { |a| a["username"] }).to eq(%w{foo foobar}) expect(api.get("users").map { |a| a["user"]["username"] }).to eq([ "bar" ]) end diff --git a/spec/integration/recipes/accumulator_spec.rb b/spec/integration/recipes/accumulator_spec.rb index 4a193bd7f0..65a05fcdc5 100644 --- a/spec/integration/recipes/accumulator_spec.rb +++ b/spec/integration/recipes/accumulator_spec.rb @@ -119,7 +119,7 @@ describe "Accumulators" do log_level :warn EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) result.error! # runs only a single template resource (in the outer run context, as a delayed resource) expect(result.stdout.scan(/template\S+ action create/).size).to eql(1) @@ -221,7 +221,7 @@ describe "Accumulators" do log_level :warn EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) result.error! # runs only a single template resource (in the outer run context, as a delayed resource) expect(result.stdout.scan(/template\S+ action create/).size).to eql(1) diff --git a/spec/integration/recipes/lwrp_inline_resources_spec.rb b/spec/integration/recipes/lwrp_inline_resources_spec.rb index 54ce94f263..a9832fe6b0 100644 --- a/spec/integration/recipes/lwrp_inline_resources_spec.rb +++ b/spec/integration/recipes/lwrp_inline_resources_spec.rb @@ -151,7 +151,7 @@ cookbook_path "#{path_to('cookbooks')}" log_level :warn EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) actual = result.stdout.lines.map { |l| l.chomp }.join("\n") expected = <<EOM * x_my_machine[me] action create diff --git a/spec/integration/recipes/lwrp_spec.rb b/spec/integration/recipes/lwrp_spec.rb index 3bc008d4f8..3494924a8f 100644 --- a/spec/integration/recipes/lwrp_spec.rb +++ b/spec/integration/recipes/lwrp_spec.rb @@ -44,7 +44,7 @@ cookbook_path "#{path_to('cookbooks')}" log_level :warn EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'l-w-r-p::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'l-w-r-p::default'", cwd: chef_dir) expect(result.stdout).to match(/\* l_w_r_p_foo\[me\] action create \(up to date\)/) expect(result.stdout).not_to match(/WARN: You are overriding l_w_r_p_foo/) result.error! diff --git a/spec/integration/recipes/notifies_spec.rb b/spec/integration/recipes/notifies_spec.rb index b008e4ade7..2aa02554b9 100644 --- a/spec/integration/recipes/notifies_spec.rb +++ b/spec/integration/recipes/notifies_spec.rb @@ -32,7 +32,7 @@ cookbook_path "#{path_to('cookbooks')}" log_level :warn EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) # our delayed notification should run at the end of the parent run_context after the baz resource expect(result.stdout).to match(/\* apt_update\[\] action nothing \(skipped due to action :nothing\)\s+\* log\[foo\] action write\s+\* log\[bar\] action write\s+\* apt_update\[\] action nothing \(skipped due to action :nothing\)/) result.error! @@ -73,7 +73,7 @@ cookbook_path "#{path_to('cookbooks')}" log_level :warn EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) # our delayed notification should run at the end of the parent run_context after the baz resource expect(result.stdout).to match(/\* log\[bar\] action write\s+\* log\[baz\] action write\s+\* log\[foo\] action write/) result.error! @@ -116,7 +116,7 @@ cookbook_path "#{path_to('cookbooks')}" log_level :warn EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) # our delayed notification should run at the end of the parent run_context after the baz resource expect(result.stdout).to match(/\* log\[bar\] action write\s+\* log\[baz\] action write\s+\* log\[foo\] action write/) # and only run once @@ -163,7 +163,7 @@ cookbook_path "#{path_to('cookbooks')}" log_level :warn EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) # the delayed notification from the sub-resource is de-duplicated by the notification already in the parent run_context expect(result.stdout).to match(/\* log\[quux\] action write\s+\* notifying_test\[whatever\] action run\s+\* log\[bar\] action write\s+\* log\[baz\] action write\s+\* log\[foo\] action write\s+\* log\[baz\] action write/) # and only run once @@ -197,7 +197,7 @@ cookbook_path "#{path_to('cookbooks')}" log_level :warn EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) # the delayed notification from the sub-resource is de-duplicated by the notification already in the parent run_context expect(result.stdout).to match(/\* log\[bar\] action write\s+\* log\[baz\] action write\s+\* log\[foo\] action write/) # and only run once @@ -240,7 +240,7 @@ cookbook_path "#{path_to('cookbooks')}" log_level :warn EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) expect(result.stdout).to match(/\* log\[bar\] action write\s+\* log\[foo\] action write\s+\* log\[baz\] action write/) result.error! end @@ -280,7 +280,7 @@ cookbook_path "#{path_to('cookbooks')}" log_level :warn EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) expect(result.stdout).to match(/\* log\[bar\] action write\s+\* log\[foo\] action write\s+\* log\[baz\] action write/) result.error! end @@ -317,7 +317,7 @@ cookbook_path "#{path_to('cookbooks')}" log_level :warn EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) expect(result.stdout).to match(/Chef::Exceptions::ResourceNotFound/) expect(result.exitstatus).not_to eql(0) end @@ -357,7 +357,7 @@ cookbook_path "#{path_to('cookbooks')}" log_level :warn EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) expect(result.stdout).not_to match(/CHEF-3694/) result.error! end @@ -385,7 +385,7 @@ cookbook_path "#{path_to('cookbooks')}" log_level :warn EOM - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) expect(result.stdout).to match /\* log\[a, b\] action write/ result.error! end diff --git a/spec/integration/recipes/notifying_block_spec.rb b/spec/integration/recipes/notifying_block_spec.rb index 6a1287c7b1..6c50854038 100644 --- a/spec/integration/recipes/notifying_block_spec.rb +++ b/spec/integration/recipes/notifying_block_spec.rb @@ -55,7 +55,7 @@ describe "notifying_block" do # 2. delayed notifications are de-dup'd in the subcontext # 3. delayed notifications (to resources inside the subcontext) are run at the end of the subcontext it "should run alpha, beta, gamma, and delta in that order" do - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) expect(result.stdout).to match(/\* log\[alpha\] action write\s+\* log\[beta\] action write\s+\* log\[gamma\] action write\s+Converging 1 resources\s+\* log\[delta\] action write/) result.error! end @@ -103,7 +103,7 @@ describe "notifying_block" do # 1. notifying block will correctly update wrapping new_resource updated_by_last_action status # 2. delayed notifications from a subcontext inside a resource will notify resources in their outer run_context it "should run foo, quux, bar, and baz in that order" do - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) expect(result.stdout).to match(/\* log\[foo\] action write\s+\* log\[quux\] action write\s+\* log\[bar\] action write\s+\* log\[baz\] action write/) result.error! end diff --git a/spec/integration/recipes/remote_directory.rb b/spec/integration/recipes/remote_directory.rb index 77fe183136..a0e3e23ef3 100644 --- a/spec/integration/recipes/remote_directory.rb +++ b/spec/integration/recipes/remote_directory.rb @@ -50,7 +50,7 @@ describe Chef::Resource::RemoteDirectory do end EOM end - shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'test::default'", :cwd => chef_dir) + shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'test::default'", cwd: chef_dir) end def mode_of(path) diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb index 63525f0081..36fabd232d 100644 --- a/spec/integration/solo/solo_spec.rb +++ b/spec/integration/solo/solo_spec.rb @@ -26,7 +26,7 @@ describe "chef-solo" do file "config/solo.rb", <<EOM chef_repo_path "#{@repository_dir}" EOM - result = shell_out("ruby bin/chef-solo -c \"#{path_to('config/solo.rb')}\" -l debug", :cwd => chef_dir) + result = shell_out("ruby bin/chef-solo -c \"#{path_to('config/solo.rb')}\" -l debug", cwd: chef_dir) result.error! end @@ -78,7 +78,7 @@ EOM cookbook_path "#{path_to('cookbooks')}" file_cache_path "#{path_to('config/cache')}" EOM - result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", :cwd => chef_dir) + result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", cwd: chef_dir) result.error! expect(result.stdout).to include("ITWORKS") end @@ -93,7 +93,7 @@ EOM {"run_list":["x::default"]} E - result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -j '#{path_to('config/node.json')}' -l debug", :cwd => chef_dir) + result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -j '#{path_to('config/node.json')}' -l debug", cwd: chef_dir) result.error! expect(result.stdout).to include("ITWORKS") end @@ -114,7 +114,7 @@ E cookbook_path "#{path_to('cookbooks')}" file_cache_path "#{path_to('config/cache')}" EOM - result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", :cwd => chef_dir) + result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", cwd: chef_dir) expect(result.exitstatus).to eq(0) # For CHEF-5120 this becomes 1 expect(result.stdout).to include("WARN: MissingCookbookDependency") end @@ -131,7 +131,7 @@ EOM end it "should exit with an error" do - result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", :cwd => chef_dir) + result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", cwd: chef_dir) expect(result.exitstatus).to eq(1) expect(result.stdout).to include("Chef::Exceptions::CookbookChefVersionMismatch") end @@ -148,7 +148,7 @@ EOM end it "should exit with an error" do - result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", :cwd => chef_dir) + result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", cwd: chef_dir) expect(result.exitstatus).to eq(1) expect(result.stdout).to include("Chef::Exceptions::CookbookOhaiVersionMismatch") end @@ -187,13 +187,13 @@ EOM # Instantiate the first chef-solo run threads << Thread.new do - s1 = Process.spawn("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug -L #{path_to('logs/runs.log')}", :chdir => chef_dir) + s1 = Process.spawn("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug -L #{path_to('logs/runs.log')}", chdir: chef_dir) Process.waitpid(s1) end # Instantiate the second chef-solo run threads << Thread.new do - s2 = Process.spawn("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug -L #{path_to('logs/runs.log')}", :chdir => chef_dir) + s2 = Process.spawn("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug -L #{path_to('logs/runs.log')}", chdir: chef_dir) Process.waitpid(s2) end |