# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # # for lib/nano/enumerable/commonality.rb # # Extracted Fri Oct 28 14:20:18 EDT 2005 # Unit Tools Reap Test Extractor # require 'nano/enumerable/commonality.rb' require 'test/unit' class TCEnumerable < Test::Unit::TestCase def test_commonality a = [1,2,2,3,3,3] r = { 2 => [2,2], 3 => [3,3,3] } assert_equal( r, a.commonality ) a = [1,2,2,3,3,3] r = {false=>[1, 2, 2], true=>[3, 3, 3]} assert_equal( r, a.commonality { |x| x > 2 } ) end end