Sha256: a4f127d776f0f3ab55441337f7ee0a335216bab54c54f0b462b62476836de8e1
Contents?: true
Size: 690 Bytes
Versions: 1
Compression:
Stored size: 690 Bytes
Contents
# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # # for lib/facets/core/enumerable/partition_by.rb # # Extracted Fri Feb 16 02:00:36 EST 2007 # Project.rb Test Extraction # 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.8.49 | test/lib/facets/core/enumerable/test_partition_by.rb |