# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # # for lib/facets/core/hash/each.rb # # Extracted Tue Jun 06 09:30:19 EDT 2006 # Unit Tools Reap Test Extractor # require 'facets/core/hash/each.rb' require 'test/unit' class TCHash < Test::Unit::TestCase def test_each_1 h = { :a=>1, :b=>2, :c=>3 } a = [] h.each { |v| a << v } assert_equal( [1,2,3], a.sort ) end def test_each_2 h = { 'a'=>1, 'b'=>2, 'c'=>3 } a = [] h.each { |k,v| a << [k,v] } assert_equal( [['a',1],['b',2],['c',3]], a.sort ) end end