summaryrefslogtreecommitdiff
path: root/spec/ruby/core/hash/to_hash_spec.rb
blob: 5a173c2ab5ae9c39790e4047c16158da6495cec7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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