/vendor/gems/facets-2.4.5/test/core/hash/test_stringify_keys.rb
Ruby | 21 lines | 14 code | 6 blank | 1 comment | 0 complexity | b2757faf92768aae6d0c16847a51e4ee MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
- # Test facets/hash/stringify_keys.rb
- require 'facets/hash/stringify_keys.rb'
- require 'test/unit'
- class TestHashStringifyKeys < Test::Unit::TestCase
- def test_stringify_keys
- foo = { :a=>1, :b=>2 }
- assert_equal( { "a"=>1, "b"=>2 }, foo.stringify_keys )
- assert_equal( { :a =>1, :b=>2 }, foo )
- end
- def test_stringify_keys!
- foo = { :a=>1, :b=>2 }
- assert_equal( { "a"=>1, "b"=>2 }, foo.stringify_keys! )
- assert_equal( { "a"=>1, "b"=>2 }, foo )
- end
- end