diff options
author | Jos Backus <jos@catnook.com> | 2015-10-20 13:26:16 -0700 |
---|---|---|
committer | Jos Backus <jos@catnook.com> | 2015-10-20 13:26:32 -0700 |
commit | af7379d0beeceacf0c7806ac1811a472dbc15a3b (patch) | |
tree | 2807fa8c7b38cedfd5636716fcfb6edb2b6e40d5 /spec/unit | |
parent | b705e745b398449e572f1ed582575eada2e4a471 (diff) | |
download | chef-af7379d0beeceacf0c7806ac1811a472dbc15a3b.tar.gz |
Route all tags access through Chef::Node#{tags,tag}
This should avoid node tags not being initialized properly to an empty
Array.
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/node_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/recipe_spec.rb | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb index 5f3bed2833..9e78223318 100644 --- a/spec/unit/node_spec.rb +++ b/spec/unit/node_spec.rb @@ -785,7 +785,7 @@ describe Chef::Node do end it "should not set the tags attribute to an empty array if it is already defined" do - node.normal[:tags] = [ "radiohead" ] + node.tag("radiohead") node.consume_external_attrs(@ohai_data, {}) expect(node.tags).to eql([ "radiohead" ]) end diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb index da6cf561f5..b242f28e11 100644 --- a/spec/unit/recipe_spec.rb +++ b/spec/unit/recipe_spec.rb @@ -621,19 +621,19 @@ describe Chef::Recipe do it "should set tags via tag" do recipe.tag "foo" - expect(node[:tags]).to include("foo") + expect(node.tags).to include("foo") end it "should set multiple tags via tag" do recipe.tag "foo", "bar" - expect(node[:tags]).to include("foo") - expect(node[:tags]).to include("bar") + expect(node.tags).to include("foo") + expect(node.tags).to include("bar") end it "should not set the same tag twice via tag" do recipe.tag "foo" recipe.tag "foo" - expect(node[:tags]).to eql([ "foo" ]) + expect(node.tags).to eql([ "foo" ]) end it "should return the current list of tags from tag with no arguments" do @@ -657,13 +657,13 @@ describe Chef::Recipe do it "should remove a tag from the tag list via untag" do recipe.tag "foo" recipe.untag "foo" - expect(node[:tags]).to eql([]) + expect(node.tags).to eql([]) end it "should remove multiple tags from the tag list via untag" do recipe.tag "foo", "bar" recipe.untag "bar", "foo" - expect(node[:tags]).to eql([]) + expect(node.tags).to eql([]) end end |