summaryrefslogtreecommitdiff
path: root/spec/hashie/dash_spec.rb
diff options
context:
space:
mode:
authorMichael Bleigh <michael@intridea.com>2009-11-12 10:05:00 -0500
committerMichael Bleigh <michael@intridea.com>2009-11-12 10:05:13 -0500
commit9a4c4d9fb455fccfd32f1ccaab4f42558593ebf2 (patch)
tree3e7523c6104d9e08df5053491b1cae86dc848e77 /spec/hashie/dash_spec.rb
parentf04ca62dc09d4c00500c0a64cb4bc3b12e7b4a0b (diff)
downloadhashie-9a4c4d9fb455fccfd32f1ccaab4f42558593ebf2.tar.gz
Adds pretty inspect for Dash.
Diffstat (limited to 'spec/hashie/dash_spec.rb')
-rw-r--r--spec/hashie/dash_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/hashie/dash_spec.rb b/spec/hashie/dash_spec.rb
index d9fc01e..97ed3c1 100644
--- a/spec/hashie/dash_spec.rb
+++ b/spec/hashie/dash_spec.rb
@@ -45,6 +45,16 @@ describe Hashie::Dash do
end
end
+ describe ' initializing with a Hash' do
+ it 'should not be able to initialize non-existent properties' do
+ lambda{DashTest.new(:bork => 'abc')}.should raise_error(NoMethodError)
+ end
+
+ it 'should set properties that it is able to' do
+ DashTest.new(:first_name => 'Michael').first_name.should == 'Michael'
+ end
+ end
+
describe ' defaults' do
before do
@dash = DashTest.new