Skip to content
Permalink
Browse files
Add regression test for Enumerable#cycle
  • Loading branch information
ksss committed Nov 11, 2016
1 parent 126d554 commit 7685783af4872b99265e2ea9c41ac00baf191c30
Showing 1 changed file with 7 additions and 0 deletions.
@@ -128,6 +128,13 @@ def a.each
["a", "b", "c"].cycle(2) { |v| a << v }
assert_equal ["a", "b", "c", "a", "b", "c"], a
assert_raise(TypeError) { ["a", "b", "c"].cycle("a") { |v| a << v } }

empty = Class.new do
include Enumerable
def each
end
end
assert_nil empty.new.cycle { break :nope }
end

assert("Enumerable#find_index") do

0 comments on commit 7685783

Please sign in to comment.