aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support/random.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/random.rb')
-rw-r--r--spec/support/random.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/support/random.rb b/spec/support/random.rb
index f0168b9ef..59e1a1475 100644
--- a/spec/support/random.rb
+++ b/spec/support/random.rb
@@ -7,8 +7,12 @@ module Support
SecureRandom.hex
end
- def random_int
- (random_number * PRETTY_LARGE_INT).to_i
+ def random_element from
+ from[random_int(from.size)]
+ end
+
+ def random_int max_plus_one=PRETTY_LARGE_INT
+ (random_number * max_plus_one).to_i
end
def random_number