Sha256: f7cfab8269fdc27a6df0e2f96b1fd7dcdfa497f38cb49d2ea9c79e5d974a9b0e

Contents?: true

Size: 504 Bytes

Versions: 4

Compression:

Stored size: 504 Bytes

Contents

covers 'facets/array/commonality'

tests Array do

  unit :commonality do
    a = [1,2,2,3,3,3]
    e = { 2 => [2,2], 3 => [3,3,3] }
    r = a.commonality
    r.assert == e
  end

  unit :commonality => "with block" do
    a = [1,2,2,3,3,3]
    e = {false=>[1, 2, 2], true=>[3, 3, 3]}
    r = a.commonality{ |x| x > 2 }
    r.assert == e
  end

  unit :collisions => "alias for commonality" do
    a = [1,2,2,3,3,3]
    e = { 2 => [2,2], 3 => [3,3,3] }
    r = a.collisions
    r.assert == e
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facets-2.9.1 test/core/array/test_commonality.rb
facets-2.9.0 test/core/array/test_commonality.rb
facets-2.9.0.pre.2 test/core/array/test_commonality.rb
facets-2.9.0.pre.1 test/core/array/test_commonality.rb