diff options
-rw-r--r-- | chef/lib/chef/node/attribute.rb | 2 | ||||
-rw-r--r-- | chef/spec/unit/node_spec.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/chef/lib/chef/node/attribute.rb b/chef/lib/chef/node/attribute.rb index ccd87a1d77..c4556bfeae 100644 --- a/chef/lib/chef/node/attribute.rb +++ b/chef/lib/chef/node/attribute.rb @@ -425,7 +425,7 @@ class Chef self[symbol] = Mash.new self[symbol] else - raise ArgumentError, "Attribute #{symbol} is not defined!" unless auto_vivifiy_on_read + raise NoMethodError, "Undefined method or attribute `#{symbol}' on `node'" end elsif symbol.to_s =~ /=$/ key_to_set = symbol.to_s[/^(.+)=$/, 1] || symbol diff --git a/chef/spec/unit/node_spec.rb b/chef/spec/unit/node_spec.rb index a7d44a2f62..77883bab62 100644 --- a/chef/spec/unit/node_spec.rb +++ b/chef/spec/unit/node_spec.rb @@ -249,7 +249,7 @@ describe Chef::Node do end it "should raise an ArgumentError if you ask for an attribute that doesn't exist via method_missing" do - lambda { @node.sunshine }.should raise_error(ArgumentError) + lambda { @node.sunshine }.should raise_error(NoMethodError) end it "should allow you to iterate over attributes with each_attribute" do |