diff options
Diffstat (limited to 'spec/unit/property_spec.rb')
-rw-r--r-- | spec/unit/property_spec.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/unit/property_spec.rb b/spec/unit/property_spec.rb index 8c01bf7b49..326948713b 100644 --- a/spec/unit/property_spec.rb +++ b/spec/unit/property_spec.rb @@ -367,10 +367,14 @@ describe "Chef::Resource.property" do expect(resource.x.object_id).to eq(value.object_id) end it "Multiple instances of x receive the exact same value" do - # TODO this isn't really great behavior, but it's noted here so we find out - # if it changed. expect(resource.x.object_id).to eq(resource_class.new('blah2').x.object_id) end + it "The default value is frozen" do + expect(resource.x).to be_frozen + end + it "The default value cannot be written to" do + expect { resource.x[:a] = 1 }.to raise_error RuntimeError, /frozen/ + end end with_property ':x, default: lazy { {} }' do |