summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-09-28 16:01:41 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-10-25 09:29:29 -0700
commitc38fd335b667ccc8dcb1a0ae276be44f344c9fea (patch)
treeed7aee19dc9c988be7d49a4f58df8a815ee4a8b0
parent55432829161a0294f2be81fe6064d6914bad9384 (diff)
downloadchef-c38fd335b667ccc8dcb1a0ae276be44f344c9fea.tar.gz
green tests
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/node/attribute.rb2
-rw-r--r--lib/chef/node/attribute_collections.rb1
-rw-r--r--lib/chef/node/immutable_collections.rb8
3 files changed, 5 insertions, 6 deletions
diff --git a/lib/chef/node/attribute.rb b/lib/chef/node/attribute.rb
index 8f2fdb7956..747f7f623c 100644
--- a/lib/chef/node/attribute.rb
+++ b/lib/chef/node/attribute.rb
@@ -565,7 +565,7 @@ class Chef
return nil if components.compact.empty?
- components.inject(ImmutableMash.new(self, {})) do |merged, component|
+ components.inject(ImmutableMash.new({}, self)) do |merged, component|
Chef::Mixin::DeepMerge.hash_only_merge!(merged, component)
end
end
diff --git a/lib/chef/node/attribute_collections.rb b/lib/chef/node/attribute_collections.rb
index 529054ed94..c7482799cc 100644
--- a/lib/chef/node/attribute_collections.rb
+++ b/lib/chef/node/attribute_collections.rb
@@ -156,7 +156,6 @@ class Chef
end
def [](key)
- pp __root.class
__root.top_level_breadcrumb ||= key
value = super
if !key?(key)
diff --git a/lib/chef/node/immutable_collections.rb b/lib/chef/node/immutable_collections.rb
index 5a2625cdc5..9d34048c79 100644
--- a/lib/chef/node/immutable_collections.rb
+++ b/lib/chef/node/immutable_collections.rb
@@ -27,9 +27,9 @@ class Chef
def immutablize(value)
case value
when Hash
- ImmutableMash.new(__root, value)
+ ImmutableMash.new(value, __root)
when Array
- ImmutableArray.new(__root, value)
+ ImmutableArray.new(value, __root)
else
value
end
@@ -52,7 +52,7 @@ class Chef
alias :internal_push :<<
private :internal_push
- def initialize(root = self, array_data = [])
+ def initialize(array_data, root = self)
@__root = root
array_data.each do |value|
internal_push(immutablize(value))
@@ -114,7 +114,7 @@ class Chef
alias :internal_set :[]=
private :internal_set
- def initialize(root = self, mash_data = {})
+ def initialize(mash_data, root = self)
@__root = root
mash_data.each do |key, value|
internal_set(key, immutablize(value))