Permalink
Browse files

Add regression test for Enumerable#cycle

  • Loading branch information...
ksss committed Nov 11, 2016
1 parent 126d554 commit 7685783af4872b99265e2ea9c41ac00baf191c30
Showing with 7 additions and 0 deletions.
  1. +7 −0 mrbgems/mruby-enum-ext/test/enum.rb
@@ -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.