Sha256: b47a49526bf57de19620e738dd66d20935dc4cd769dcc371fcba2f57b1d7baa0
Contents?: true
Size: 694 Bytes
Versions: 1
Compression:
Stored size: 694 Bytes
Contents
# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # # for lib/facets/core/enumerable/partition_by.rb # # Extracted Tue Apr 18 08:56:37 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.3.1 | test/lib/facets/core/enumerable/test_partition_by.rb |