Sha256: db30b8e295315557260a62b52f8bfda8224e960233027635196d65d2c57115be
Contents?: true
Size: 454 Bytes
Versions: 8
Compression:
Stored size: 454 Bytes
Contents
require 'facets/enumerable/count' require 'test/unit' class TC_Enumerable_Count < Test::Unit::TestCase def test_count_01 e = [ 'a', '1', 'a' ] assert_equal( 1, e.count('1') ) assert_equal( 2, e.count('a') ) end def test_count_02 e = [ ['a',2], ['a',2], ['a',2], ['b',1] ] assert_equal( 3, e.count(['a',2]) ) end def test_count_03 e = { 'a' => 2, 'a' => 2, 'b' => 1 } assert_equal( 1, e.count('a',2) ) end end
Version data entries
8 entries across 8 versions & 1 rubygems