From fb97f2390d311d3c0726d1258118bd550141627f Mon Sep 17 00:00:00 2001 From: Jay Mundrawala Date: Thu, 2 Jul 2015 16:30:14 -0700 Subject: Revert "Freeze default constants" This reverts commit 705e22b975196baa6decf23f9c3a7e676d6aefc4. I'd like to revert this change because it breaks the packagecloud cookbook. See https://gist.github.com/cwebberOps/ae002be2339ca843cbb3 --- lib/chef/mixin/params_validate.rb | 1 - spec/unit/property_spec.rb | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/chef/mixin/params_validate.rb b/lib/chef/mixin/params_validate.rb index 4ab016249f..84dcfcef13 100644 --- a/lib/chef/mixin/params_validate.rb +++ b/lib/chef/mixin/params_validate.rb @@ -317,7 +317,6 @@ class Chef def _pv_default(opts, key, default_value) value = _pv_opts_lookup(opts, key) if value.nil? - default_value = default_value.freeze if !default_value.is_a?(DelayedEvaluator) opts[key] = default_value end end diff --git a/spec/unit/property_spec.rb b/spec/unit/property_spec.rb index ce0552c564..bce2b0b51b 100644 --- a/spec/unit/property_spec.rb +++ b/spec/unit/property_spec.rb @@ -367,14 +367,10 @@ 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 -- cgit v1.2.1