Merge pull request #473 from bovi/integer-step-test

Add test case for Integer#step
This commit is contained in:
Yukihiro "Matz" Matsumoto
2012-09-15 10:48:20 -07:00
+16
View File
@@ -172,3 +172,19 @@ assert('Integer#upto', '15.2.8.3.27') do
end
a == 6
end
# Not ISO specified
assert('Integer#step') do
a = []
b = []
1.step(3) do |i|
a << i
end
1.step(6, 2) do |i|
b << i
end
a == [1, 2, 3] and
b == [1, 3, 5]
end