diff options
author | John McCrae <john.mccrae@progress.com> | 2022-06-27 14:49:45 -0700 |
---|---|---|
committer | John McCrae <john.mccrae@progress.com> | 2022-06-27 14:49:45 -0700 |
commit | b3a01fb27cd349b5d78d58c339069252ea3c8552 (patch) | |
tree | 40b84a49c85e54216a5d3fc6364c4409832c8f00 | |
parent | cc7c8f835e83f2a16c64ffaf0d9252d8c07f473b (diff) | |
download | chef-b3a01fb27cd349b5d78d58c339069252ea3c8552.tar.gz |
tuning random ugly tests to use an expect statement
Signed-off-by: John McCrae <john.mccrae@progress.com>
-rw-r--r-- | spec/integration/client/client_spec.rb | 2 | ||||
-rw-r--r-- | spec/integration/recipes/accumulator_spec.rb | 2 | ||||
-rw-r--r-- | spec/integration/recipes/unified_mode_spec.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb index 3e6905262f..b493671dc4 100644 --- a/spec/integration/client/client_spec.rb +++ b/spec/integration/client/client_spec.rb @@ -594,7 +594,7 @@ describe "chef-client" do 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.error! + expect(result.exitstatus).to eq(0) expect(IO.read(path_to("tempfile.txt")).strip).to eq("this is my file") end diff --git a/spec/integration/recipes/accumulator_spec.rb b/spec/integration/recipes/accumulator_spec.rb index 7c67a6a66e..e1d87c4d53 100644 --- a/spec/integration/recipes/accumulator_spec.rb +++ b/spec/integration/recipes/accumulator_spec.rb @@ -127,7 +127,7 @@ describe "Accumulators" do EOM result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) - expect { shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir) }.not_to raise_error + expect(result.exitstatus).to eq(0) # 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) # hash order is insertion order in ruby >= 1.9, so this next line does test that all calls were in the correct order diff --git a/spec/integration/recipes/unified_mode_spec.rb b/spec/integration/recipes/unified_mode_spec.rb index dee937571b..fbcc96f151 100644 --- a/spec/integration/recipes/unified_mode_spec.rb +++ b/spec/integration/recipes/unified_mode_spec.rb @@ -872,7 +872,7 @@ describe "Unified Mode" do # in recipe mode we should still run normally with a compile/converge mode expect(result.stdout).to include("first: bar") expect(result.stdout).not_to include("first: foo") - result.error! + expect(result.exitstatus).to eq(0) end end |