PageRenderTime 44ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/gems/facets-2.4.5/test/core/hash/test_stringify_keys.rb

https://bitbucket.org/mediashelf/fedora-migrator
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
  1. # Test facets/hash/stringify_keys.rb
  2. require 'facets/hash/stringify_keys.rb'
  3. require 'test/unit'
  4. class TestHashStringifyKeys < Test::Unit::TestCase
  5. def test_stringify_keys
  6. foo = { :a=>1, :b=>2 }
  7. assert_equal( { "a"=>1, "b"=>2 }, foo.stringify_keys )
  8. assert_equal( { :a =>1, :b=>2 }, foo )
  9. end
  10. def test_stringify_keys!
  11. foo = { :a=>1, :b=>2 }
  12. assert_equal( { "a"=>1, "b"=>2 }, foo.stringify_keys! )
  13. assert_equal( { "a"=>1, "b"=>2 }, foo )
  14. end
  15. end