diff options
-rw-r--r-- | chef/spec/unit/node_spec.rb | 4 | ||||
-rw-r--r-- | chef/spec/unit/run_context_spec.rb | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/chef/spec/unit/node_spec.rb b/chef/spec/unit/node_spec.rb index 9741f94bfb..4577d5098b 100644 --- a/chef/spec/unit/node_spec.rb +++ b/chef/spec/unit/node_spec.rb @@ -447,6 +447,10 @@ describe Chef::Node do @node.ldap_replication_password.should eql("forsure") @node.smokey.should eql("robinson") end + + it "gives a sensible error when attempting to load a missing attributes file" do + lambda { @node.include_attribute("nope-this::doesnt-exist") }.should raise_error(Chef::Exceptions::CookbookNotFound) + end end describe "roles" do diff --git a/chef/spec/unit/run_context_spec.rb b/chef/spec/unit/run_context_spec.rb index f90acd15a5..7b52cefd6d 100644 --- a/chef/spec/unit/run_context_spec.rb +++ b/chef/spec/unit/run_context_spec.rb @@ -60,6 +60,11 @@ describe Chef::RunContext do @run_context.resource_collection[3].to_s.should == "cat[peanut]" @run_context.resource_collection[4].to_s.should == "cat[fat peanut]" end + + it "loads all the attribute files in the cookbook collection" do + @run_context.loaded_fully_qualified_attribute?("test", "george").should be_true + @node[:george].should == "washington" + end end end |