Sha256: c07d30d08d26eae0bb61ec87850dbe62b0f8e40a61f2f42b800ca46fa4c14b3d

Contents?: true

Size: 329 Bytes

Versions: 16

Compression:

Stored size: 329 Bytes

Contents

require 'facets/enumerable/occur'
require 'test/unit'

class TC_Enumerable_Occur < Test::Unit::TestCase

  def test_occur
    arr = [:a,:b,:a]
    assert_equal( [:b], arr.occur(1) )
    assert_equal( [:a], arr.occur(2) )
    assert_equal( [:b], arr.occur(1..1) )
    assert_equal( [:a], arr.occur{ |n| n % 2 == 0 } )
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
facets-2.8.4 test/core/enumerable/test_occur.rb
facets-2.8.3 test/core/enumerable/test_occur.rb
facets-2.8.2 test/core/enumerable/test_occur.rb
facets-2.8.1 test/core/enumerable/test_occur.rb
facets-2.8.0 test/core/enumerable/test_occur.rb
facets-2.7.0 test/core/enumerable/test_occur.rb
facets-2.6.0 test/core/enumerable/test_occur.rb
facets-2.4.0 test/enumerable/test_occur.rb
facets-2.4.1 test/enumerable/test_occur.rb
facets-2.4.3 test/core/enumerable/test_occur.rb
facets-2.4.2 test/core/enumerable/test_occur.rb
facets-2.4.4 test/core/enumerable/test_occur.rb
facets-2.5.1 test/core/enumerable/test_occur.rb
facets-2.5.0 test/core/enumerable/test_occur.rb
facets-2.4.5 test/core/enumerable/test_occur.rb
facets-2.5.2 test/core/enumerable/test_occur.rb