/vendor/gems/facets-2.4.5/test/core/enumerable/test_uniq_by.rb

https://bitbucket.org/mediashelf/fedora-migrator · Ruby · 13 lines · 9 code · 4 blank · 0 comment · 0 complexity · 3c2972f73f0b14450e95539523d81d92 MD5 · raw file

  1. require 'facets/enumerable/uniq_by'
  2. require 'test/unit'
  3. class TC_Enumerable_UniqBy < Test::Unit::TestCase
  4. def test_uniq_by
  5. a = [-5, -4, -3, -2, -1, 0]
  6. r = (-5..5).to_a.uniq_by{|i| i*i }
  7. assert_equal( a, r )
  8. end
  9. end