summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-09-01 10:53:55 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-09-01 10:53:55 -0700
commit632e4cb3083f3932df3b7fec89a1d52b5d5ed570 (patch)
tree9fbaa6bc5f0cc50649c646dd8ac7c2d089c3908d
parent6c8f6d834c30216aa8d566345c96ae62520013e8 (diff)
downloadchef-632e4cb3083f3932df3b7fec89a1d52b5d5ed570.tar.gz
Revert "more warning to debug"
This reverts commit 6c8f6d834c30216aa8d566345c96ae62520013e8.
-rw-r--r--lib/chef/resource.rb2
-rw-r--r--spec/unit/property_spec.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 8b248877e3..5bef40625f 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -809,7 +809,7 @@ class Chef
end
if !options[:default].frozen? && (options[:default].is_a?(Array) || options[:default].is_a?(Hash))
- Chef::Log.debug("Property #{self}.#{name} has an array or hash default (#{options[:default]}). This means that if one resource modifies or appends to it, all other resources of the same type will also see the changes. Either freeze the constant with `.freeze` to prevent appending, or use lazy { #{options[:default].inspect} }.")
+ Chef::Log.warn("Property #{self}.#{name} has an array or hash default (#{options[:default]}). This means that if one resource modifies or appends to it, all other resources of the same type will also see the changes. Either freeze the constant with `.freeze` to prevent appending, or use lazy { #{options[:default].inspect} }.")
end
local_properties = properties(false)
diff --git a/spec/unit/property_spec.rb b/spec/unit/property_spec.rb
index b2e9e2acde..55eaead9ba 100644
--- a/spec/unit/property_spec.rb
+++ b/spec/unit/property_spec.rb
@@ -476,8 +476,8 @@ describe "Chef::Resource.property" do
end
end
- it "when a property is declared with default: {}, a debug level warning is issued" do
- expect(Chef::Log).to receive(:debug).with(match(/^Property .+\.x has an array or hash default \(\{\}\)\. This means that if one resource modifies or appends to it, all other resources of the same type will also see the changes\. Either freeze the constant with \`\.freeze\` to prevent appending, or use lazy \{ \{\} \}\.$/))
+ it "when a property is declared with default: {}, a warning is issued" do
+ expect(Chef::Log).to receive(:warn).with(match(/^Property .+\.x has an array or hash default \(\{\}\)\. This means that if one resource modifies or appends to it, all other resources of the same type will also see the changes\. Either freeze the constant with \`\.freeze\` to prevent appending, or use lazy \{ \{\} \}\.$/))
resource_class.class_eval("property :x, default: {}", __FILE__, __LINE__)
expect(resource.x).to eq({})
end