summaryrefslogtreecommitdiff
path: root/spec/ruby/core/hash/clone_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/hash/clone_spec.rb')
-rw-r--r--spec/ruby/core/hash/clone_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/ruby/core/hash/clone_spec.rb b/spec/ruby/core/hash/clone_spec.rb
new file mode 100644
index 0000000000..188ae1c807
--- /dev/null
+++ b/spec/ruby/core/hash/clone_spec.rb
@@ -0,0 +1,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
+