Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added spec for Enumerator#rewind to ensure implementation is clearing…

… #peek lookahead value
  • Loading branch information...
commit 6345f327463de0b271996bff9a43dcb681751117 1 parent df45c82
@jtdowney jtdowney authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 spec/ruby/shared/enumerator/rewind.rb
View
9 spec/ruby/shared/enumerator/rewind.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.