/vendor/gems/facets-2.4.5/test/core/hash/test_inverse.rb
Ruby | 15 lines | 11 code | 4 blank | 0 comment | 0 complexity | f0a99e4645cfa80c0efc1a350f410704 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
- require 'facets/hash/inverse'
- require 'test/unit'
- class TC_Hash_Inverse < Test::Unit::TestCase
- def test_inverse
- h1 = { :a=>1, :b=>2, :c=>2 }
- h2 = h1.inverse
- assert_equal( :a, h2[1] )
- assert( h2[2].include?(:b) )
- assert( h2[2].include?(:c) )
- end
- end