summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-01-23 18:52:07 -0800
committerTim Smith <tsmith84@gmail.com>2020-01-23 21:12:33 -0800
commit2c1460f24c2d1bd20fe7197903f3a7509e35febf (patch)
tree7c9ff99f9f130d61623fb401793a792cd6a12906
parentf0c950f439c8904f4c552c131b9cd1441607dd45 (diff)
downloadchef-load_warnings_be_gone.tar.gz
Cleanup the specs for the load_cookbooks warningsload_warnings_be_gone
Remove all these expects Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--spec/integration/knife/chef_fs_data_store_spec.rb5
-rw-r--r--spec/integration/knife/deps_spec.rb11
-rw-r--r--spec/unit/cookbook/cookbook_version_loader_spec.rb3
3 files changed, 0 insertions, 19 deletions
diff --git a/spec/integration/knife/chef_fs_data_store_spec.rb b/spec/integration/knife/chef_fs_data_store_spec.rb
index acb7f7fbe7..95fee18257 100644
--- a/spec/integration/knife/chef_fs_data_store_spec.rb
+++ b/spec/integration/knife/chef_fs_data_store_spec.rb
@@ -54,7 +54,6 @@ describe "ChefFSDataStore tests", :workstation do
context "GET /TYPE" do
it "knife list -z -R returns everything" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).twice
knife("list -z -Rfp /").should_succeed <<~EOM
/acls/
/acls/clients/
@@ -119,7 +118,6 @@ describe "ChefFSDataStore tests", :workstation do
end
it "knife delete -z -r /cookbooks/x works" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).at_least(3).times
knife("delete -z -r /cookbooks/x").should_succeed "Deleted /cookbooks/x\n"
knife("list -z -Rfp /cookbooks").should_succeed ""
end
@@ -157,7 +155,6 @@ describe "ChefFSDataStore tests", :workstation do
end
it "knife show -z /cookbooks/x/metadata.rb works" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).once
knife("show -z /cookbooks/x/metadata.rb").should_succeed "/cookbooks/x/metadata.rb:\n#{cookbook_x_100_metadata_rb}\n"
end
@@ -193,7 +190,6 @@ describe "ChefFSDataStore tests", :workstation do
end
it "knife cookbook upload works" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).once
knife("cookbook upload -z --cookbook-path #{path_to("cookbooks_to_upload")} x").should_succeed stderr: <<~EOM
Uploading x [1.0.0]
Uploaded 1 cookbook.
@@ -446,7 +442,6 @@ describe "ChefFSDataStore tests", :workstation do
context "GET /TYPE" do
it "knife list -z -R returns everything" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).once
knife("list -z -Rfp /").should_succeed <<~EOM
/clients/
/clients/x.json
diff --git a/spec/integration/knife/deps_spec.rb b/spec/integration/knife/deps_spec.rb
index e2baf8d997..4dfccf38de 100644
--- a/spec/integration/knife/deps_spec.rb
+++ b/spec/integration/knife/deps_spec.rb
@@ -41,7 +41,6 @@ describe "knife deps", :workstation do
file "cookbooks/soup/recipes/chicken.rb", ""
end
it "knife deps reports all dependencies" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).twice
knife("deps /roles/starring.json").should_succeed <<~EOM
/roles/minor.json
/cookbooks/quiche
@@ -61,7 +60,6 @@ describe "knife deps", :workstation do
file "cookbooks/soup/recipes/chicken.rb", ""
end
it "knife deps reports all dependencies" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).twice
knife("deps /roles/starring.json").should_succeed <<~EOM
/roles/minor.json
/cookbooks/quiche
@@ -96,7 +94,6 @@ describe "knife deps", :workstation do
file "nodes/mort.json", { "run_list" => %w{role[minor] recipe[quiche] recipe[soup::chicken]} }
end
it "knife deps reports just the node" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).twice
knife("deps /nodes/mort.json").should_succeed <<~EOM
/roles/minor.json
/cookbooks/quiche
@@ -111,7 +108,6 @@ describe "knife deps", :workstation do
file "cookbooks/quiche/recipes/default.rb", ""
end
it "knife deps reports just the cookbook" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).once
knife("deps /cookbooks/quiche").should_succeed "/cookbooks/quiche\n"
end
end
@@ -123,7 +119,6 @@ depends "kettle"'
file "cookbooks/quiche/recipes/default.rb", ""
end
it "knife deps reports just the cookbook" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).twice
knife("deps /cookbooks/quiche").should_succeed "/cookbooks/kettle\n/cookbooks/quiche\n"
end
end
@@ -153,7 +148,6 @@ depends "kettle"'
end
it "knife deps reports all dependencies" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).twice
knife("deps /nodes/mort.json").should_succeed <<~EOM
/environments/desert.json
/roles/minor.json
@@ -164,7 +158,6 @@ depends "kettle"'
EOM
end
it "knife deps * reports all dependencies of all things" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).twice
knife("deps /nodes/*").should_succeed <<~EOM
/roles/minor.json
/nodes/bart.json
@@ -176,7 +169,6 @@ depends "kettle"'
EOM
end
it "knife deps a b reports all dependencies of a and b" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).twice
knife("deps /nodes/bart.json /nodes/mort.json").should_succeed <<~EOM
/roles/minor.json
/nodes/bart.json
@@ -188,7 +180,6 @@ depends "kettle"'
EOM
end
it "knife deps --tree /* shows dependencies in a tree" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).twice
knife("deps --tree /nodes/*").should_succeed <<~EOM
/nodes/bart.json
/roles/minor.json
@@ -223,13 +214,11 @@ depends "foo"'
end
it "knife deps prints each once" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).at_least(3).times
knife("deps /cookbooks/foo").should_succeed(
stdout: "/cookbooks/baz\n/cookbooks/bar\n/cookbooks/foo\n"
)
end
it "knife deps --tree prints each once" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./).at_least(3).times
knife("deps --tree /cookbooks/foo").should_succeed(
stdout: "/cookbooks/foo\n /cookbooks/bar\n /cookbooks/baz\n /cookbooks/foo\n"
)
diff --git a/spec/unit/cookbook/cookbook_version_loader_spec.rb b/spec/unit/cookbook/cookbook_version_loader_spec.rb
index 02b9726c4c..518ffa7d2d 100644
--- a/spec/unit/cookbook/cookbook_version_loader_spec.rb
+++ b/spec/unit/cookbook/cookbook_version_loader_spec.rb
@@ -125,7 +125,6 @@ describe Chef::Cookbook::CookbookVersionLoader do
end
it "gives deprecation warning called with #load and raise error for Cookbook not found" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./)
expect { cookbook_loader.load }.to raise_error(Chef::Exceptions::CookbookNotFoundInRepo)
end
@@ -150,7 +149,6 @@ describe Chef::Cookbook::CookbookVersionLoader do
end
it "gives deprecation warning to us load! when called with #load and raises error" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./)
expect { cookbook_loader.load }.to raise_error("THIS METADATA HAS A BUG")
end
@@ -183,7 +181,6 @@ describe Chef::Cookbook::CookbookVersionLoader do
end
it "gives deprecation warning to use load! method when called with #load and raises error for invalid metadata" do
- expect(Chef::Log).to receive(:warn).with(/load method is deprecated. Please use load! instead./)
expect { cookbook_loader.load }.to raise_error(Chef::Exceptions::MetadataNotValid, error_message)
end