summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-02-01 14:48:10 -0800
committerGitHub <noreply@github.com>2021-02-01 14:48:10 -0800
commit0290643a65125538365e169778adab5792b793db (patch)
tree19cfacc498e1d929643ab7c2c9a8233619187770
parent5cfeff3c4006bbf172aa57586947ffce1fd17314 (diff)
parent81f61427d9443e5322594e52034c1f829c810d2d (diff)
downloadchef-0290643a65125538365e169778adab5792b793db.tar.gz
Merge pull request #10959 from chef/lcg/rspec-3.10-fixes
fix specs for spec 3.10
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock28
-rw-r--r--spec/unit/knife/supermarket_share_spec.rb11
3 files changed, 20 insertions, 21 deletions
diff --git a/Gemfile b/Gemfile
index f24cf11a04..99e7cf3c6b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -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