1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2019-06-27 21:02:36 +02:00
parent c940397116
commit d80e44deec
157 changed files with 581 additions and 543 deletions

View file

@ -10,7 +10,7 @@ describe "Enumerator#each_with_index" do
enum1 = [1,2,3].select
enum2 = enum1.each_with_index
enum2.should be_an_instance_of(Enumerator)
enum1.should_not === enum2
enum1.should_not == enum2
end
it "raises an ArgumentError if passed extra arguments" do
@ -28,9 +28,7 @@ describe "Enumerator#each_with_index" do
it "returns the iterator's return value" do
[1,2,3].select.with_index { |a,b| false }.should == []
end
end
describe "Enumerator#each_with_index" do
it "returns the correct value if chained with itself" do
[:a].each_with_index.each_with_index.to_a.should == [[[:a,0],0]]
[:a].each.with_index.with_index.to_a.should == [[[:a,0],0]]