diff options
author | Tim Smith <tsmith@chef.io> | 2021-02-01 14:48:10 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-01 14:48:10 -0800 |
commit | 0290643a65125538365e169778adab5792b793db (patch) | |
tree | 19cfacc498e1d929643ab7c2c9a8233619187770 | |
parent | 5cfeff3c4006bbf172aa57586947ffce1fd17314 (diff) | |
parent | 81f61427d9443e5322594e52034c1f829c810d2d (diff) | |
download | chef-0290643a65125538365e169778adab5792b793db.tar.gz |
Merge pull request #10959 from chef/lcg/rspec-3.10-fixes
fix specs for spec 3.10
-rw-r--r-- | Gemfile | 2 | ||||
-rw-r--r-- | Gemfile.lock | 28 | ||||
-rw-r--r-- | spec/unit/knife/supermarket_share_spec.rb | 11 |
3 files changed, 20 insertions, 21 deletions
@@ -50,7 +50,7 @@ end group(:development, :test) do gem "rake" - gem "rspec", "=3.9.0" # remove pin once https://github.com/chef/chef/issues/10817 is resolved + gem "rspec" gem "webmock" gem "fauxhai-ng" # for chef-utils gem end diff --git a/Gemfile.lock b/Gemfile.lock index beac35b346..5ce0bce247 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,10 +8,10 @@ GIT GIT remote: https://github.com/chef/ohai.git - revision: 4843bb3d6bbf8ad73a23bac7b3feba8cf9597b5c + revision: d175d5189c8dc7bfed4689927fa4c6312fec80c1 branch: master specs: - ohai (17.0.12) + ohai (17.0.13) chef-config (>= 12.8, < 18) chef-utils (>= 16.0, < 18) ffi (~> 1.9) @@ -294,22 +294,22 @@ GEM rb-readline (0.5.5) regexp_parser (2.0.3) rexml (3.2.4) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.3) - rspec-support (~> 3.9.3) - rspec-expectations (3.9.4) + rspec (3.10.0) + rspec-core (~> 3.10.0) + rspec-expectations (~> 3.10.0) + rspec-mocks (~> 3.10.0) + rspec-core (3.10.1) + rspec-support (~> 3.10.0) + rspec-expectations (3.10.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) + rspec-support (~> 3.10.0) rspec-its (1.3.0) rspec-core (>= 3.0.0) rspec-expectations (>= 3.0.0) - rspec-mocks (3.9.1) + rspec-mocks (3.10.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.4) + rspec-support (~> 3.10.0) + rspec-support (3.10.2) rubocop (1.9.1) parallel (~> 1.10) parser (>= 3.0.0.0) @@ -441,7 +441,7 @@ DEPENDENCIES pry-stack_explorer rake rb-readline - rspec (= 3.9.0) + rspec ruby-prof (< 1.3.0) ruby-shadow webmock diff --git a/spec/unit/knife/supermarket_share_spec.rb b/spec/unit/knife/supermarket_share_spec.rb index f6c44f4cd8..088cef9dfd 100644 --- a/spec/unit/knife/supermarket_share_spec.rb +++ b/spec/unit/knife/supermarket_share_spec.rb @@ -46,7 +46,9 @@ describe Chef::Knife::SupermarketShare do allow(@knife).to receive(:shell_out!).and_return(true) @stdout = StringIO.new + @stderr = StringIO.new allow(@knife.ui).to receive(:stdout).and_return(@stdout) + allow(@knife.ui).to receive(:stderr).and_return(@stderr) end describe "run" do @@ -140,7 +142,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 +155,6 @@ describe Chef::Knife::SupermarketShare do end it "does not upload the cookbook" do - allow(@knife).to receive(:shell_out!).and_return(true) expect(@knife).not_to receive(:do_upload) @knife.run end @@ -164,10 +167,6 @@ describe Chef::Knife::SupermarketShare do @upload_response = double("Net::HTTPResponse") allow(Chef::CookbookSiteStreamingUploader).to receive(:post).and_return(@upload_response) - @stdout = StringIO.new - @stderr = StringIO.new - allow(@knife.ui).to receive(:stdout).and_return(@stdout) - allow(@knife.ui).to receive(:stderr).and_return(@stderr) allow(File).to receive(:open).and_return(true) end |