summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-enumerator/test/enumerator.rb
diff options
context:
space:
mode:
authorksss <[email protected]>2014-03-15 00:45:58 +0900
committerksss <[email protected]>2014-03-15 08:21:39 +0900
commit0bb7f5e950de68cfcb188fa7df79dc2537ee45c1 (patch)
tree5099c0afcf996b2531cc019aca077e54512258ea /mrbgems/mruby-enumerator/test/enumerator.rb
parent9447c637a558e30d6315fd712f91b349587a8a34 (diff)
downloadmruby-0bb7f5e950de68cfcb188fa7df79dc2537ee45c1.tar.gz
mruby-0bb7f5e950de68cfcb188fa7df79dc2537ee45c1.zip
fix variable name typo
Diffstat (limited to 'mrbgems/mruby-enumerator/test/enumerator.rb')
-rw-r--r--mrbgems/mruby-enumerator/test/enumerator.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/mrbgems/mruby-enumerator/test/enumerator.rb b/mrbgems/mruby-enumerator/test/enumerator.rb
index 71e70733c..857615991 100644
--- a/mrbgems/mruby-enumerator/test/enumerator.rb
+++ b/mrbgems/mruby-enumerator/test/enumerator.rb
@@ -72,6 +72,21 @@ assert 'Enumerator#with_object' do
assert_equal([55, 3628800], ret)
end
+assert 'Enumerator#with_object arguments' do
+ to_three = Enumerator.new do |y|
+ 3.times do |x|
+ y << x
+ end
+ end
+
+ a = []
+ to_three_with_string = to_three.with_object("foo")
+ to_three_with_string.each do |x,string|
+ a << "#{string}:#{x}"
+ end
+ assert_equal ["foo:0","foo:1","foo:2"], a
+end
+
assert 'Enumerator#inspect' do
e = (0..10).each
assert_equal("#<Enumerator: 0..10:each>", e.inspect)