summaryrefslogtreecommitdiffhomepage
path: root/test/t
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-09-15 10:48:20 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2012-09-15 10:48:20 -0700
commit4bf51cdd420aee2b40ef0a48fa798da0c82db726 (patch)
tree355ac0b85fcffd6aef5b684ddf98e419f9d3b394 /test/t
parent8bed663762301b22f9c89c0821a16bdf78bd239d (diff)
parentb4647224b765380e5f40d0af7927355709bce346 (diff)
downloadmruby-4bf51cdd420aee2b40ef0a48fa798da0c82db726.tar.gz
mruby-4bf51cdd420aee2b40ef0a48fa798da0c82db726.zip
Merge pull request #473 from bovi/integer-step-test
Add test case for Integer#step
Diffstat (limited to 'test/t')
-rw-r--r--test/t/integer.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/t/integer.rb b/test/t/integer.rb
index 872723445..56ea6bf13 100644
--- a/test/t/integer.rb
+++ b/test/t/integer.rb
@@ -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