Commit 4bf51cdd authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

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

Add test case for Integer#step
parents 8bed6637 b4647224
...@@ -172,3 +172,19 @@ assert('Integer#upto', '15.2.8.3.27') do ...@@ -172,3 +172,19 @@ assert('Integer#upto', '15.2.8.3.27') do
end end
a == 6 a == 6
end 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
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