aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support/random.rb
diff options
context:
space:
mode:
authorRobert2017-09-29 18:23:56 +0200
committerRobert2017-10-02 10:52:07 +0200
commit1bc4ab6684803a3974bd65f6531bd43a57c15fd0 (patch)
treebc30e8698ada3f660633adbd28e88083f39896a6 /spec/support/random.rb
parentf034dc2999a56295178c64921e6f059adc1a7bd9 (diff)
downloadchouette-core-1bc4ab6684803a3974bd65f6531bd43a57c15fd0.tar.bz2
Refs: #4627@2h;
Comprehensive Tests for ComplianceControl Class Level Default Attributes
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