* array.c (rb_ary_shuffle_bang): check number of argument.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-08-26 00:49:54 +00:00
parent 3dc6edf793
commit 7e4015e16d
3 changed files with 8 additions and 0 deletions

View file

@ -1893,6 +1893,7 @@ class TestArray < Test::Unit::TestCase
end
gen = Random.new(0)
assert_raise(ArgumentError) {[1, 2, 3].shuffle(1, random: gen)}
srand(0)
100.times do
assert_equal([0, 1, 2].shuffle, [0, 1, 2].shuffle(random: gen))