# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # # for lib/facets/core/hash/traverse.rb # # Extracted Mon Jun 05 08:14:29 EDT 2006 # Unit Tools Reap Test Extractor # require 'facets/core/hash/traverse.rb' require 'test/unit' class TCHash < 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