aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2011-08-15 16:56:33 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2011-08-15 16:56:33 -0500
commit9482554f31f3ac7f941e6239890c60fcc01975e1 (patch)
tree979375ea99b948c31368bbc15bcd245eadd11488 /activesupport/test
parentbb4e790dff3b345b4080263eb0b17da172b6e67f (diff)
downloadrails-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.rb10
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