Sha256: b53978ad814c5e5f5fd5f8690938fd9e5572e87462bc7aeb72ac024bf84724e7

Contents?: true

Size: 740 Bytes

Versions: 1

Compression:

Stored size: 740 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/hash/traverse.rb
#
# Extracted Wed Jul 05 11:47:50 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


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.4.5 test/lib/facets/core/hash/test_traverse.rb