Sha256: c07d30d08d26eae0bb61ec87850dbe62b0f8e40a61f2f42b800ca46fa4c14b3d
Contents?: true
Size: 329 Bytes
Versions: 16
Compression:
Stored size: 329 Bytes
Contents
require 'facets/enumerable/occur' require 'test/unit' class TC_Enumerable_Occur < Test::Unit::TestCase def test_occur arr = [:a,:b,:a] assert_equal( [:b], arr.occur(1) ) assert_equal( [:a], arr.occur(2) ) assert_equal( [:b], arr.occur(1..1) ) assert_equal( [:a], arr.occur{ |n| n % 2 == 0 } ) end end
Version data entries
16 entries across 16 versions & 1 rubygems