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 e6a438cd73..1aa8c54f5c 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -1456,6 +1456,12 @@ class TestArray < Test::Unit::TestCase
assert_raise(ArgumentError) { a.uniq!(1) }
assert_raise(ArgumentError) { f.uniq!(1) }
assert_raise(RuntimeError) { f.uniq! }
+
+ assert_nothing_raised do
+ a = [ {c: "b"}, {c: "r"}, {c: "w"}, {c: "g"}, {c: "g"} ]
+ a.sort_by!{|e| e[:c]}
+ a.uniq! {|e| e[:c]}
+ end
end
def test_uniq_bang_with_block