Sha256: e132551ffc8bc05cf1d9f38a8816838f49c87c45e84379d1e9f2278629bf0343

Contents?: true

Size: 310 Bytes

Versions: 21

Compression:

Stored size: 310 Bytes

Contents

describe "Enumerable#each_with_index" do
  before :each do
    @b = EnumerableSpecs::Numerous.new(2, 5, 3, 6, 1, 4)
  end

  it "passes each element and its index to block" do
    @a = []
    @b.each_with_index { |o, i| @a << [o, i] }
    @a.should == [[2, 0], [5, 1], [3, 2], [6, 3], [1, 4], [4, 5]]
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
opal-0.3.41 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.40 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.39 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.38 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.37 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.36 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.35 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.34 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.33 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.32 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.31 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.30 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.29 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.28 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.27 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.26 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.25 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.22 spec/core/enumerable/each_with_index_spec.rb
opal-0.3.21 test/core/enumerable/each_with_index_spec.rb
opal-0.3.20 test/core/enumerable/each_with_index_spec.rb