diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2021-02-01 14:07:41 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2021-03-22 22:18:59 -0700 |
commit | e7715f45b24d82b6c060ca83f7e9a38537d6a257 (patch) | |
tree | 4b6de0ee14a180a363da62bd46a86575f5e0d5f4 | |
parent | 40b2c7cef98926a0d564b31dc36410d2b27f57d5 (diff) | |
download | chef-e7715f45b24d82b6c060ca83f7e9a38537d6a257.tar.gz |
fix specs for spec 3.10
using a proper instance_double avoids the errors and that's the right
thing to do here.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | spec/unit/knife/supermarket_share_spec.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/unit/knife/supermarket_share_spec.rb b/spec/unit/knife/supermarket_share_spec.rb index f6c44f4cd8..9e9d520540 100644 --- a/spec/unit/knife/supermarket_share_spec.rb +++ b/spec/unit/knife/supermarket_share_spec.rb @@ -140,7 +140,9 @@ describe Chef::Knife::SupermarketShare do before do allow(Chef::CookbookSiteStreamingUploader).to receive(:create_build_dir).and_return("/var/tmp/dummy") @knife.config = { dry_run: true } - allow(@knife).to receive_message_chain(:shell_out!, :stdout).and_return("file") + @so = instance_double("Mixlib::ShellOut") + allow(@knife).to receive(:shell_out!).and_return(@so) + allow(@so).to receive(:stdout).and_return("file") end it "should list files in the tarball" do @@ -151,7 +153,7 @@ describe Chef::Knife::SupermarketShare do end it "does not upload the cookbook" do - allow(@knife).to receive(:shell_out!).and_return(true) + allow(@knife).to receive(:shell_out!).and_return(@so) expect(@knife).not_to receive(:do_upload) @knife.run end |