diff options
author | Vasu1105 <vasundhara.jagdale@msystechnologies.com> | 2020-01-21 14:12:39 +0530 |
---|---|---|
committer | Vasu1105 <vasundhara.jagdale@msystechnologies.com> | 2020-01-22 10:50:38 +0530 |
commit | d0d16ae5ed3e3b017df147656388840553797925 (patch) | |
tree | d004d4e58dd6c90b3cf52c51cabdb77e2920d903 | |
parent | 57c73184517371d334ea26008aebc734cc918813 (diff) | |
download | chef-d0d16ae5ed3e3b017df147656388840553797925.tar.gz |
Fixed failing specs
Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
-rw-r--r-- | spec/integration/knife/upload_spec.rb | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/spec/integration/knife/upload_spec.rb b/spec/integration/knife/upload_spec.rb index 29362fdbaa..7d1ef68e45 100644 --- a/spec/integration/knife/upload_spec.rb +++ b/spec/integration/knife/upload_spec.rb @@ -197,7 +197,7 @@ describe "knife upload", :workstation do end it "knife upload adds the new files" do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).twice + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload /").should_succeed <<~EOM Created /clients/y.json Updated /cookbooks/x @@ -217,7 +217,7 @@ describe "knife upload", :workstation do end it "knife upload --no-diff adds the new files" do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).twice + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload --no-diff /").should_succeed <<~EOM Created /clients/y.json Updated /cookbooks/x @@ -494,7 +494,7 @@ describe "knife upload", :workstation do # technically we shouldn't have deleted missing files. But ... cookbooks # are a special case. it "knife upload of the cookbook itself succeeds" do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).once + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x EOM @@ -504,7 +504,7 @@ describe "knife upload", :workstation do end it "knife upload --purge of the cookbook itself succeeds" do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).once + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x EOM @@ -520,7 +520,7 @@ describe "knife upload", :workstation do end it "knife upload of the cookbook succeeds" do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).once + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x EOM @@ -538,7 +538,7 @@ describe "knife upload", :workstation do end it "knife upload of the cookbook succeeds" do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).once + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x EOM @@ -554,7 +554,7 @@ describe "knife upload", :workstation do end it "knife upload --freeze freezes the cookbook" do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).twice + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload --freeze /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x EOM @@ -577,11 +577,11 @@ describe "knife upload", :workstation do end it "knife upload fails to upload the frozen cookbook" do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).once + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload /cookbooks/frozencook").should_fail "ERROR: /cookbooks failed to write: Cookbook frozencook is frozen\n" end it "knife upload --force uploads the frozen cookbook" do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).once + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload --force /cookbooks/frozencook").should_succeed <<~EOM Updated /cookbooks/frozencook EOM @@ -603,7 +603,7 @@ describe "knife upload", :workstation do end it "knife upload /cookbooks/x uploads the local version" do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).once + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("diff --name-status /cookbooks").should_succeed <<~EOM M\t/cookbooks/x/metadata.rb D\t/cookbooks/x/onlyin1.0.1.rb @@ -641,6 +641,7 @@ describe "knife upload", :workstation do D\t/cookbooks/x/onlyin1.0.1.rb A\t/cookbooks/x/onlyin1.0.0.rb EOM + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload --purge /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x EOM @@ -659,7 +660,7 @@ describe "knife upload", :workstation do end it "knife upload /cookbooks/x uploads the local version generates metadata.json and uploads it." do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).once + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload --purge /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x EOM @@ -675,7 +676,7 @@ describe "knife upload", :workstation do end it "knife upload /cookbooks/x uploads the local version and generates metadata.json before upload and uploads it." do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).once + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("diff --name-status /cookbooks").should_succeed <<~EOM M\t/cookbooks/x/metadata.rb D\t/cookbooks/x/onlyin1.0.1.rb @@ -698,7 +699,7 @@ describe "knife upload", :workstation do end it "knife upload /cookbooks/x uploads the new version" do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).once + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload --purge /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x EOM @@ -801,7 +802,7 @@ describe "knife upload", :workstation do file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0", "\nchef_version '~> 999.0'") end it "knife upload succeeds" do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).once + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload /cookbooks/x").should_succeed <<~EOM Created /cookbooks/x EOM @@ -1411,7 +1412,7 @@ describe "knife upload", :workstation do end it "knife upload / uploads everything" do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).twice + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload /").should_succeed <<~EOM Updated /acls/groups/blah.json Created /clients/x.json @@ -1519,7 +1520,7 @@ describe "knife upload", :workstation do end it "knife upload updates everything" do - expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).once + expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Use load! instead/).at_least(2).times knife("upload /").should_succeed <<~EOM Updated /acls/groups/blah.json Updated /clients/x.json |