Sha256: 4b13dc62c4c747349c572d8156cf3435f7c2080ef2a91f45cce5f3333baa65e4

Contents?: true

Size: 407 Bytes

Versions: 16

Compression:

Stored size: 407 Bytes

Contents

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

16 entries across 16 versions & 1 rubygems

Version Path
facets-2.8.4 test/core/hash/test_alias.rb
facets-2.8.3 test/core/hash/test_alias.rb
facets-2.8.2 test/core/hash/test_alias.rb
facets-2.8.1 test/core/hash/test_alias.rb
facets-2.8.0 test/core/hash/test_alias.rb
facets-2.7.0 test/core/hash/test_alias.rb
facets-2.6.0 test/core/hash/test_alias.rb
facets-2.4.0 test/hash/test_alias.rb
facets-2.4.1 test/hash/test_alias.rb
facets-2.4.3 test/core/hash/test_alias.rb
facets-2.4.2 test/core/hash/test_alias.rb
facets-2.4.4 test/core/hash/test_alias.rb
facets-2.4.5 test/core/hash/test_alias.rb
facets-2.5.0 test/core/hash/test_alias.rb
facets-2.5.1 test/core/hash/test_alias.rb
facets-2.5.2 test/core/hash/test_alias.rb