Module: RandTestHelpers

Included in:
RandArrayTest, RandHashTest, RandStringTest
Defined in:
lib/rand.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#picker(enum, enum_check, method, n = 50) ⇒ Object



239
240
241
# File 'lib/rand.rb', line 239

def picker(enum, enum_check, method, n=50)
  (1..n).all?{ enum_check.include? enum.send(method) }
end

#try_shuffling(enum, enum_c, method) ⇒ Object



243
244
245
246
247
248
249
250
# File 'lib/rand.rb', line 243

def try_shuffling(enum, enum_c, method)
  rv = nil
  10.times{
   rv = enum.send method
   break if rv != enum_c
  }
  rv
end