summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-01-24 15:50:30 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2020-01-27 11:32:29 -0800
commitd7b479691c4d85b670187fd17191be1d23c88407 (patch)
tree890a3627f60ab670f9bf4423604dec95f27b2b6b
parent32d0a00b3f6324fbc616617ba9da67f41d3f081c (diff)
downloadchef-d7b479691c4d85b670187fd17191be1d23c88407.tar.gz
get rid of the failures due to deprecation warnings
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--spec/unit/cookbook/cookbook_version_loader_spec.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/unit/cookbook/cookbook_version_loader_spec.rb b/spec/unit/cookbook/cookbook_version_loader_spec.rb
index 518ffa7d2d..b1c2a46827 100644
--- a/spec/unit/cookbook/cookbook_version_loader_spec.rb
+++ b/spec/unit/cookbook/cookbook_version_loader_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Daniel DeLeo (<dan@chef.io>)
-# Copyright:: Copyright 2014-2018, Chef Software Inc.
+# Copyright:: Copyright 2014-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -124,8 +124,9 @@ describe Chef::Cookbook::CookbookVersionLoader do
expect { cookbook_loader.load! }.to raise_error(Chef::Exceptions::CookbookNotFoundInRepo)
end
- it "gives deprecation warning called with #load and raise error for Cookbook not found" do
- expect { cookbook_loader.load }.to raise_error(Chef::Exceptions::CookbookNotFoundInRepo)
+ it "gives deprecation warning called with #load" do
+ Chef::Config[:treat_deprecation_warnings_as_errors] = false
+ cookbook_loader.load
end
end
@@ -149,6 +150,7 @@ describe Chef::Cookbook::CookbookVersionLoader do
end
it "gives deprecation warning to us load! when called with #load and raises error" do
+ Chef::Config[:treat_deprecation_warnings_as_errors] = false
expect { cookbook_loader.load }.to raise_error("THIS METADATA HAS A BUG")
end
@@ -181,6 +183,7 @@ 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
+ Chef::Config[:treat_deprecation_warnings_as_errors] = false
expect { cookbook_loader.load }.to raise_error(Chef::Exceptions::MetadataNotValid, error_message)
end