Sha256: 09c645d64b79084b413712cc9ba34f3b00a4f9d179c8e09a7c8594fe237c0a9c

Contents?: true

Size: 261 Bytes

Versions: 49

Compression:

Stored size: 261 Bytes

Contents

describe "Enumerator#with_index" do
  it "returns the result of the previously called method" do
    [1, 2, 3].each.with_index { |item, index| item * 2 }.should == [1, 2, 3]
    [1, 2, 3].map.with_index  { |item, index| item * 2 }.should == [2, 4, 6]
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
opal-1.8.3.rc1 spec/opal/core/enumerator/with_index_spec.rb
opal-1.8.2 spec/opal/core/enumerator/with_index_spec.rb
opal-1.8.1 spec/opal/core/enumerator/with_index_spec.rb
opal-1.8.0 spec/opal/core/enumerator/with_index_spec.rb
opal-1.8.0.beta1 spec/opal/core/enumerator/with_index_spec.rb
opal-1.7.4 spec/opal/core/enumerator/with_index_spec.rb
opal-1.8.0.alpha1 spec/opal/core/enumerator/with_index_spec.rb
opal-1.7.3 spec/opal/core/enumerator/with_index_spec.rb
opal-1.7.2 spec/opal/core/enumerator/with_index_spec.rb
opal-1.7.1 spec/opal/core/enumerator/with_index_spec.rb
opal-1.7.0 spec/opal/core/enumerator/with_index_spec.rb
opal-1.7.0.rc1 spec/opal/core/enumerator/with_index_spec.rb
opal-1.6.1 spec/opal/core/enumerator/with_index_spec.rb
opal-1.6.0 spec/opal/core/enumerator/with_index_spec.rb
opal-1.6.0.rc1 spec/opal/core/enumerator/with_index_spec.rb
opal-1.6.0.alpha1 spec/opal/core/enumerator/with_index_spec.rb
opal-1.5.1 spec/opal/core/enumerator/with_index_spec.rb
opal-1.5.0 spec/opal/core/enumerator/with_index_spec.rb
opal-1.5.0.rc1 spec/opal/core/enumerator/with_index_spec.rb
opal-1.4.1 spec/opal/core/enumerator/with_index_spec.rb