Add Enumerable#all?(&block) tests

This commit is contained in:
Jun Hiroe
2014-03-16 18:45:34 +09:00
parent 18bebd3acd
commit cf556f0ad9
+16
View File
@@ -8,6 +8,22 @@ end
assert('Enumerable#all?', '15.3.2.2.1') do
assert_true([1,2,3].all?)
assert_false([1,false,3].all?)
a = [2,4,6]
all = a.all? do |e|
if e % 2 == 0
true
end
end
assert_true(all)
a = [2,4,7]
all = a.all? do |e|
if e % 2 == 0
true
end
end
assert_false(all)
end
assert('Enumerable#any?', '15.3.2.2.2') do