diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-15 07:34:03 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-15 07:34:03 +0000 |
commit | d0885b5cd816b3b4aa5a613af3c028c1123999a6 (patch) | |
tree | be8a5adb9514df9c91b4848e81c32be0415f3356 /test/ruby/test_array.rb | |
parent | 111327c535e82716306460499fa5d9d1bde1b6a9 (diff) |
test_array.rb: add test
* test/ruby/test_array.rb (test_last2): add test for Array#last with
length argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r-- | test/ruby/test_array.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 873c49783f..f4faa9bedc 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -1794,6 +1794,11 @@ class TestArray < Test::Unit::TestCase assert_raise(ArgumentError) { [0].first(-1) } end + def test_last2 + assert_equal([0], [0].last(2)) + assert_raise(ArgumentError) { [0].last(-1) } + end + def test_shift2 assert_equal(0, ([0] * 16).shift) # check |