diff options
Diffstat (limited to 'spec/ruby/core/hash/allocate_spec.rb')
-rw-r--r-- | spec/ruby/core/hash/allocate_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/ruby/core/hash/allocate_spec.rb b/spec/ruby/core/hash/allocate_spec.rb new file mode 100644 index 0000000000..d607f235bd --- /dev/null +++ b/spec/ruby/core/hash/allocate_spec.rb @@ -0,0 +1,15 @@ +require File.expand_path('../../../spec_helper', __FILE__) + +describe "Hash.allocate" do + it "returns an instance of Hash" do + hsh = Hash.allocate + hsh.should be_an_instance_of(Hash) + end + + it "returns a fully-formed instance of Hash" do + hsh = Hash.allocate + hsh.size.should == 0 + hsh[:a] = 1 + hsh.should == { a: 1 } + end +end |