summaryrefslogtreecommitdiff
path: root/test/ruby/test_enum.rb
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_enum.rb19
1 files changed, 19 insertions, 0 deletions
@@ -13,6 +13,16 @@ class TestEnumerable < Test::Unit::TestCase
yield 3
yield 1
yield 2
end
end
@verbose = $VERBOSE
@@ -42,6 +52,10 @@ class TestEnumerable < Test::Unit::TestCase
a = []
@obj.grep(2) {|x| a << x }
assert_equal([2, 2], a)
end
def test_count
@@ -109,6 +123,7 @@ class TestEnumerable < Test::Unit::TestCase
def test_first
assert_equal(1, @obj.first)
assert_equal([1, 2, 3], @obj.first(3))
end
def test_sort
@@ -275,6 +290,10 @@ class TestEnumerable < Test::Unit::TestCase
def test_take_while
assert_equal([1,2], @obj.take_while {|x| x <= 2})
end
def test_drop