From a8d5109721deb5d90687f38e10bb37765a5ac65a Mon Sep 17 00:00:00 2001 From: John Keiser Date: Tue, 1 Sep 2015 19:29:53 -0700 Subject: Make file verification deprecation print the proper source loc --- spec/unit/property_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/unit/property_spec.rb') diff --git a/spec/unit/property_spec.rb b/spec/unit/property_spec.rb index a9b592ec46..50764aa7a2 100644 --- a/spec/unit/property_spec.rb +++ b/spec/unit/property_spec.rb @@ -481,7 +481,7 @@ describe "Chef::Resource.property" do end it "when a property is declared with default: {}, a warning is issued" do - expect(Chef::Log).to receive(:deprecation).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 \{ \{\} \}\.$/)) + expect(Chef::Log).to receive(:deprecation).with( /^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 \{ \{\} \}\.$/, /property_spec\.rb/ ) resource_class.class_eval("property :x, default: {}", __FILE__, __LINE__) expect(resource.x).to eq({}) end -- cgit v1.2.1