Sha256: cb3f0a598611abc31aa444afa5b79e03be0b4c6519c8ede0d5d497b5df444c6e

Contents?: true

Size: 694 Bytes

Versions: 1

Compression:

Stored size: 694 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/enumerable/partition_by.rb
#
# Extracted Wed Aug 23 18:22:52 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.30 test/lib/facets/core/enumerable/test_partition_by.rb