diff options
Diffstat (limited to 'spec/ruby/core/array/each_spec.rb')
| -rw-r--r-- | spec/ruby/core/array/each_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/ruby/core/array/each_spec.rb b/spec/ruby/core/array/each_spec.rb index 57d6082f01..73a4c36b17 100644 --- a/spec/ruby/core/array/each_spec.rb +++ b/spec/ruby/core/array/each_spec.rb @@ -7,13 +7,13 @@ require_relative '../enumerable/shared/enumeratorized' # Mutating the array while it is being iterated is discouraged as it can result in confusing behavior. # Yet a Ruby implementation must not crash in such a case, and following the simple CRuby behavior makes sense. # CRuby simply reads the array storage and checks the size for every iteration; -# like `i = 0; while i < size; yield self[i]; end` +# like `i = 0; while i < size; yield self[i]; i += 1; end` describe "Array#each" do it "yields each element to the block" do a = [] x = [1, 2, 3] - x.each { |item| a << item }.should equal(x) + x.each { |item| a << item }.should.equal?(x) a.should == [1, 2, 3] end |
