diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/property_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/resource/file/verification_spec.rb | 2 |
2 files changed, 2 insertions, 2 deletions
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 diff --git a/spec/unit/resource/file/verification_spec.rb b/spec/unit/resource/file/verification_spec.rb index 04ae9ad629..6b929789c8 100644 --- a/spec/unit/resource/file/verification_spec.rb +++ b/spec/unit/resource/file/verification_spec.rb @@ -88,7 +88,7 @@ describe Chef::Resource::File::Verification do end it "warns about deprecation when \%{file} is used" do - expect(Chef::Log).to receive(:deprecation).with(/%{file} is deprecated/) + expect(Chef::Log).to receive(:deprecation).with(/%{file} is deprecated/, /verification_spec\.rb/) test_command = platform_specific_verify_command('file') Chef::Resource::File::Verification.new(parent_resource, test_command, {}) .verify(temp_path) |