summaryrefslogtreecommitdiff
path: root/spec/rubyspec/core/hash/to_hash_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/core/hash/to_hash_spec.rb')
-rw-r--r--spec/rubyspec/core/hash/to_hash_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/rubyspec/core/hash/to_hash_spec.rb b/spec/rubyspec/core/hash/to_hash_spec.rb
new file mode 100644
index 0000000000..5a173c2ab5
--- /dev/null
+++ b/spec/rubyspec/core/hash/to_hash_spec.rb
@@ -0,0 +1,14 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+
+describe "Hash#to_hash" do
+ it "returns self for Hash instances" do
+ h = {}
+ h.to_hash.should equal(h)
+ end
+
+ it "returns self for instances of subclasses of Hash" do
+ h = HashSpecs::MyHash.new
+ h.to_hash.should equal(h)
+ end
+end