Skip to content

Commit

Permalink
Add regression test for Enumerable#cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
ksss committed Nov 11, 2016
1 parent 126d554 commit 7685783
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mrbgems/mruby-enum-ext/test/enum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7685783

Please sign in to comment.