Sha256: 82adf7800beecbe9f1d1ddc624dc45273c56c135fedd2ef3e2236f3d2ca0668b
Contents?: true
Size: 482 Bytes
Versions: 16
Compression:
Stored size: 482 Bytes
Contents
require 'facets/hash/traverse' require 'test/unit' class TC_Hash_Traverse < Test::Unit::TestCase def test_traverse h = { "A" => "x", "B" => "y" } h2 = h.traverse { |k,v| [k.downcase, v.upcase] } e = { "a" => "X", "b" => "Y" } assert_not_equal( h, h2 ) assert_equal( e, h2 ) end def test_traverse! h = { "A" => "x", "B" => "y" } h.traverse! { |k,v| [k.downcase, v.upcase] } e = { "a" => "X", "b" => "Y" } assert_equal( e, h ) end end
Version data entries
16 entries across 16 versions & 1 rubygems