PageRenderTime 24ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/gems/facets-2.4.5/test/core/hash/test_inverse.rb

https://bitbucket.org/mediashelf/fedora-migrator
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
  1. require 'facets/hash/inverse'
  2. require 'test/unit'
  3. class TC_Hash_Inverse < Test::Unit::TestCase
  4. def test_inverse
  5. h1 = { :a=>1, :b=>2, :c=>2 }
  6. h2 = h1.inverse
  7. assert_equal( :a, h2[1] )
  8. assert( h2[2].include?(:b) )
  9. assert( h2[2].include?(:c) )
  10. end
  11. end