Update `mruby-enumerator` test to conform the last update.

parent 9ab7c111
......@@ -19,11 +19,8 @@ assert 'Enumerator.new' do
assert_equal [:x,:y,:z], [:x,:y,:z].each.map{|i| i}.sort
assert_equal [[:x,1],[:y,2]], {x:1, y:2}.each.map{|i| i}.sort
assert_equal [1,2,3], @obj.to_enum(:foo, 1,2,3).to_a
assert_equal [1,2,3], Enumerator.new(@obj, :foo, 1,2,3).to_a
assert_equal [1,2,3], Enumerator.new { |y| i = 0; loop { y << (i += 1) } }.take(3)
assert_equal [], Enumerator.new(false, :__id__).to_a
assert_raise(ArgumentError) { Enumerator.new }
assert_raise(ArgumentError) { @obj.to_enum }
# examples
fib = Enumerator.new do |y|
......@@ -94,11 +91,11 @@ end
assert 'Enumerator#inspect' do
e = (0..10).each
assert_equal('#<Enumerator: 0..10:each>', e.inspect)
e = Enumerator.new('FooObject', :foo, 1)
e = 'FooObject'.enum_for(:foo, 1)
assert_equal('#<Enumerator: "FooObject":foo(1)>', e.inspect)
e = Enumerator.new('FooObject', :foo, 1, 2, 3)
e = 'FooObject'.enum_for(:foo, 1, 2, 3)
assert_equal('#<Enumerator: "FooObject":foo(1, 2, 3)>', e.inspect)
e = Enumerator.new(nil, :to_s)
e = nil.enum_for(:to_s)
assert_equal('#<Enumerator: nil:to_s>', e.inspect)
end
......@@ -422,7 +419,6 @@ end
assert 'Kernel#to_enum' do
assert_equal Enumerator, [].to_enum.class
assert_raise(ArgumentError){ nil.to_enum }
end
assert 'modifying existing methods' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment