summaryrefslogtreecommitdiff
path: root/spec/unit/node_spec.rb
diff options
context:
space:
mode:
authorAdam Jacob <adam@hjksolutions.com>2008-04-07 18:14:25 -0700
committerAdam Jacob <adam@hjksolutions.com>2008-04-07 18:14:25 -0700
commit434f25ba07b5c0c50baa1e15b14a945bba3c3c3b (patch)
tree03085c689549a62d546d87e6484dde8756da2d23 /spec/unit/node_spec.rb
parentf543b509ba61dd347512e8a9e3153a49a2a8cb6b (diff)
downloadchef-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.rb14
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