Created
February 25, 2010 22:13
-
-
Save kronos/315097 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/spec/ruby/core/enumerable/cycle_spec.rb b/spec/ruby/core/enumerable/cycle_spec.rb | |
index 04705cd..1404c96 100644 | |
--- a/spec/ruby/core/enumerable/cycle_spec.rb | |
+++ b/spec/ruby/core/enumerable/cycle_spec.rb | |
@@ -15,6 +15,15 @@ describe "Enumerable#cycle" do | |
end | |
end | |
+ it "yields successive elements of the array repeatedly" do | |
+ b = [] | |
+ EnumerableSpecs::Numerous.new(1,2,3).cycle do |elem| | |
+ b << elem | |
+ break if b.size == 7 | |
+ end | |
+ b.should == [1,2,3,1,2,3,1] | |
+ end | |
+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment