summaryrefslogtreecommitdiff
path: root/test/ruby/test_enumerator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_enumerator.rb')
-rw-r--r--test/ruby/test_enumerator.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb
index 885cb4a5fe..27a71e423d 100644
--- a/test/ruby/test_enumerator.rb
+++ b/test/ruby/test_enumerator.rb
@@ -24,14 +24,13 @@ class TestEnumerator < Test::Unit::TestCase
assert_raise(StopIteration){e.next}
end
- def test_next?
+ def test_loop
e = 3.times
- assert_equal true, e.next?
- 3.times{|i|
- assert_equal true, e.next?
- assert_equal i, e.next
+ i = 0
+ loop{
+ assert_equal(i, e.next)
+ i += 1
}
- assert_equal false, e.next?
end
def test_nested_itaration