Commit 17fdd815 authored by Jun Hiroe's avatar Jun Hiroe

Add Enumerable#count test

parent 02ac5dd9
......@@ -53,3 +53,10 @@ assert("Enumerable#first") do
assert_equal [1, 2, 3], a.first(10)
assert_nil [].first
end
assert("Enumerable#count") do
a = [1, 2, 4, 2]
assert_equal 4, a.count
assert_equal 2, a.count(2)
assert_equal 3, a.count{|x| x % 2 == 0}
end
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