Sha256: 4ca56a54d0820d8e7d710204dceb834209117509f3ee6739bd42792a397a1a0d

Contents?: true

Size: 341 Bytes

Versions: 16

Compression:

Stored size: 341 Bytes

Contents

require 'facets/enumerable/inject'
require 'test/unit'

class TestEnumerableInject < Test::Unit::TestCase

  def test_inject!
    r = [1,2,3,4,5].inject!([]){ |a,i| a << i % 2 }
    e = [1,0,1,0,1]
    assert_equal(e, r)
  end

  def test_inject_equal!
    r = [].inject!([]){ |a,i| a << i % 2 }
    e = []
    assert_equal(e, r)
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

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