summaryrefslogtreecommitdiff
path: root/test/ruby/test_array.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r--test/ruby/test_array.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index d5f1594548..31a09ac335 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -1334,4 +1334,10 @@ class TestArray < Test::Unit::TestCase
end
)
end
+
+ def test_sort_by!
+ a = [1,3,5,2,4]
+ a.sort_by! {|x| -x }
+ assert_equal([5,4,3,2,1], a)
+ end
end