aboutsummaryrefslogtreecommitdiffstats
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.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index 60b08cd1bc..b4115ac5dd 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -2019,15 +2019,15 @@ class TestArray < Test::Unit::TestCase
def test_sample_random
ary = (0...10000).to_a
assert_raise(ArgumentError) {ary.sample(1, 2, random: nil)}
- gen0 = proc do
- 0.5
+ gen0 = proc do |max|
+ (max+1)/2
end
class << gen0
alias rand call
end
- gen1 = proc do
+ gen1 = proc do |max|
ary.replace([])
- 0.5
+ (max+1)/2
end
class << gen1
alias rand call