diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2021-02-01 14:07:41 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2021-02-01 14:07:41 -0800 |
commit | 25641a070dffe94ddb99ba34a7ca52e179831766 (patch) | |
tree | f3d734e21c6d312639c2b0675257a79626865cae | |
parent | 5cfeff3c4006bbf172aa57586947ffce1fd17314 (diff) | |
download | chef-25641a070dffe94ddb99ba34a7ca52e179831766.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 |