diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-12-14 16:46:12 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-12-14 16:46:12 -0800 |
commit | 54799d8d25ed4565177f2a752088a220220c7344 (patch) | |
tree | f4e631d24ab6057cbfc821b8ba6d29fa1e51c7fd /spec/unit | |
parent | 5d16e1847ad20818651af2b39c08285d94772e69 (diff) | |
download | chef-54799d8d25ed4565177f2a752088a220220c7344.tar.gz |
really always return an Arraylcg/fix-tags-and-set-unless
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/node_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb index 40e8cf8898..76cf451323 100644 --- a/spec/unit/node_spec.rb +++ b/spec/unit/node_spec.rb @@ -810,6 +810,18 @@ describe Chef::Node do expect(node.tags).to eql([]) end + it "should return an array if it is fed a string" do + node.normal[:tags] = "string" + node.consume_external_attrs(@ohai_data, {}) + expect(node.tags).to eql(["string"]) + end + + it "should return an array if it is fed a hash" do + node.normal[:tags] = {} + node.consume_external_attrs(@ohai_data, {}) + expect(node.tags).to eql([]) + end + it "deep merges attributes instead of overwriting them" do node.consume_external_attrs(@ohai_data, "one" => {"two" => {"three" => "four"}}) expect(node.one.to_hash).to eq({"two" => {"three" => "four"}}) |