Skip to content

Commit

Permalink
Added spec for Enumerator#rewind to ensure implementation is clearing…
Browse files Browse the repository at this point in the history
… #peek lookahead value
  • Loading branch information
jtdowney committed Oct 23, 2011
1 parent df45c82 commit 6345f32
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/ruby/shared/enumerator/rewind.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,13 @@
@enum.next.should == 1
end

ruby_version_is "1.9" do
it "works with peek to reset the position" do
@enum.next
@enum.next
@enum.rewind
@enum.next
@enum.peek.should == 2
end
end
end

0 comments on commit 6345f32

Please sign in to comment.