rand-rspec 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rand-rspec/integers.rb +6 -0
- data/lib/rand-rspec/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a01ba4a88ad25fc28300c2bb02b0b61f5ab0320b
|
4
|
+
data.tar.gz: a925939205424f94748664c0fb6080ae3b1f0e80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4454abc3f2926d51bb71b4e008c0073e9619704da4157bd2c3a59572f4510e82be12562bf1e390d6f749020bb8f2171bf94f2d22959847b48a4fb8badd0eb2c8
|
7
|
+
data.tar.gz: abb961e1e9df42419aa92868a26172fed6fb78d90245492146b58c26aed1a6d2d370e8fcca16e02b74a8ea42980a016055962e9a1e50b26b98035051aee44e62
|
data/lib/rand-rspec/integers.rb
CHANGED
@@ -1,10 +1,16 @@
|
|
1
1
|
module RandTest
|
2
2
|
module Numbers
|
3
|
+
|
4
|
+
FIXNUM_MAX = (2**((0.size * 8)-2) -1)
|
5
|
+
FIXNUM_MIN = -(2**((0.size * 8)-2))
|
6
|
+
|
3
7
|
def random_number_between(min, max)
|
4
8
|
min+rand(max-min+1)
|
5
9
|
end
|
10
|
+
|
6
11
|
def random_number(max)
|
7
12
|
random_number_between(0, max)
|
8
13
|
end
|
14
|
+
|
9
15
|
end
|
10
16
|
end
|
data/lib/rand-rspec/version.rb
CHANGED