aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/hash/clone_spec.rb
blob: 188ae1c807116037d304d13a797b3852d56ef2bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
require File.expand_path('../../../spec_helper', __FILE__)

describe "Hash#clone" do
  it "copies instance variable but not the objects they refer to" do
    hash = { 'key' => 'value' }

    clone = hash.clone

    clone.should == hash
    clone.object_id.should_not == hash.object_id
  end
end