Sha256: a7856a632809e31f898d3ff1558f7a6a5f89f41d58e04578d17a07dca0bd03d4
Contents?: true
Size: 694 Bytes
Versions: 1
Compression:
Stored size: 694 Bytes
Contents
# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # # for lib/facets/core/enumerable/partition_by.rb # # Extracted Tue Jul 25 10:07:15 EDT 2006 # Unit Tools Reap Test Extractor # require 'facets/core/enumerable/partition_by.rb' require 'test/unit' class TCEnumerable < Test::Unit::TestCase def test_partition_by x = (1..5).partition_by{ |n| n % 3 } o = { 0 => [3], 1 => [1, 4], 2 => [2,5] } assert_equal( o, x ) x = ["I had", 1, "dollar and", 50, "cents"].partition_by { |e| e.class } o = { String => ["I had","dollar and","cents"], Fixnum => [1,50] } assert_equal( o, x ) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
facets-1.7.0 | test/lib/facets/core/enumerable/test_partition_by.rb |