diff options
author | Adam Jacob <adam@hjksolutions.com> | 2008-04-07 18:14:25 -0700 |
---|---|---|
committer | Adam Jacob <adam@hjksolutions.com> | 2008-04-07 18:14:25 -0700 |
commit | 434f25ba07b5c0c50baa1e15b14a945bba3c3c3b (patch) | |
tree | 03085c689549a62d546d87e6484dde8756da2d23 /spec/unit/node_spec.rb | |
parent | f543b509ba61dd347512e8a9e3153a49a2a8cb6b (diff) | |
download | chef-434f25ba07b5c0c50baa1e15b14a945bba3c3c3b.tar.gz |
Adding the Params::Validate mixin, refactored Chef::Config to be a singleton, Implemented require_recipe
Diffstat (limited to 'spec/unit/node_spec.rb')
-rw-r--r-- | spec/unit/node_spec.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb index e5a92486e5..a8c456e8f5 100644 --- a/spec/unit/node_spec.rb +++ b/spec/unit/node_spec.rb @@ -18,7 +18,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -require File.join(File.dirname(__FILE__), "..", "spec_helper") +require File.expand_path(File.join(File.dirname(__FILE__), "..", "spec_helper")) describe Chef::Node do before(:each) do @@ -104,5 +104,17 @@ describe Chef::Node do lambda { @node.from_file("/tmp/monkeydiving") }.should raise_error(IOError) end + it "should allow you to iterate over attributes with each_attribute" do + @node.sunshine "is bright" + @node.canada "is a nice place" + seen_attributes = Hash.new + @node.each_attribute do |a,v| + seen_attributes[a] = v + end + seen_attributes.should have_key(:sunshine) + seen_attributes.should have_key(:canada) + seen_attributes[:sunshine].should == "is bright" + seen_attributes[:canada].should == "is a nice place" + end end
\ No newline at end of file |