/vendor/gems/facets-2.4.5/test/core/enumerable/test_uniq_by.rb
Ruby | 13 lines | 9 code | 4 blank | 0 comment | 0 complexity | 3c2972f73f0b14450e95539523d81d92 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
- require 'facets/enumerable/uniq_by'
- require 'test/unit'
- class TC_Enumerable_UniqBy < Test::Unit::TestCase
- def test_uniq_by
- a = [-5, -4, -3, -2, -1, 0]
- r = (-5..5).to_a.uniq_by{|i| i*i }
- assert_equal( a, r )
- end
- end