diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2011-08-15 16:56:33 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2011-08-15 16:56:33 -0500 |
commit | 9482554f31f3ac7f941e6239890c60fcc01975e1 (patch) | |
tree | 979375ea99b948c31368bbc15bcd245eadd11488 /activesupport/test | |
parent | bb4e790dff3b345b4080263eb0b17da172b6e67f (diff) | |
download | rails-9482554f31f3ac7f941e6239890c60fcc01975e1.tar.gz rails-9482554f31f3ac7f941e6239890c60fcc01975e1.tar.bz2 rails-9482554f31f3ac7f941e6239890c60fcc01975e1.zip |
Added Array#prepend as an alias for Array#unshift and Array#append as an alias for Array#<< [DHH]
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/array_ext_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/array_ext_test.rb b/activesupport/test/core_ext/array_ext_test.rb index e532010b18..f035505a01 100644 --- a/activesupport/test/core_ext/array_ext_test.rb +++ b/activesupport/test/core_ext/array_ext_test.rb @@ -465,3 +465,13 @@ class ArrayWrapperTests < Test::Unit::TestCase assert_equal DoubtfulToAry.new.to_ary, Array.wrap(DoubtfulToAry.new) end end + +class ArrayPrependAppendTest < Test::Unit::TestCase + def test_append + assert_equal [1, 2], [1].append(2) + end + + def test_prepend + assert_equal [2, 1], [1].prepend(2) + end +end
\ No newline at end of file |