diff options
| author | Robert | 2017-09-29 18:23:56 +0200 |
|---|---|---|
| committer | Robert | 2017-10-02 10:52:07 +0200 |
| commit | 1bc4ab6684803a3974bd65f6531bd43a57c15fd0 (patch) | |
| tree | bc30e8698ada3f660633adbd28e88083f39896a6 /spec/support/random.rb | |
| parent | f034dc2999a56295178c64921e6f059adc1a7bd9 (diff) | |
| download | chouette-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.rb | 8 |
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 |
