Sha256: 47e2bdfee1dc7adacba83b4343d9ac10014feee9f014fbd0cb2881601fe92614

Contents?: true

Size: 437 Bytes

Versions: 2

Compression:

Stored size: 437 Bytes

Contents

# Test for facets/hash/alias

require 'facets/hash/alias.rb'

require 'test/unit'

class TestHashRekey < Test::Unit::TestCase

  def test_alias!
    foo = { 'a'=>1, 'b'=>2 }
    assert_equal( { 'a'=>1, 'b'=>2, 'c'=>2 }, foo.alias!('c','b') )
    foo = { 'a'=>1, 'b'=>2 }
    assert_equal( { :a=>1, 'a'=>1, 'b'=>2 }, foo.alias!(:a,'a') )
    foo = { :a=>1, :b=>2 }
    assert_equal( { :a=>1, :b=>2 }, foo.alias!('bar','foo') )
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
facets-2.3.0 test/core/hash/test_alias.rb
facets-2.2.1 test/unit/hash/test_alias.rb