assert 2.16.1 → 2.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 42dae8dd4f32611b7674144bcef603894b475455
4
- data.tar.gz: ca45bb81a52dee8cd8bb06a123ab83e510d509e1
5
2
  SHA512:
6
- metadata.gz: bed2b7a16473d9b1465f88a895ec99f7575528304d6c8b7f189b2b715b0b775038f86297a23e95ff12ded503c49a1fb91e2aaa2017ec6af9b54b895632ac86c2
7
- data.tar.gz: 4bf23872a9fac4b948b5fde9fe5c72923d9b655a818354b2d861b90638c2bfef41113714e3be68de567056400bdebec6e8eea4d2b8f3c0e676bbbaef24aea5f0
3
+ metadata.gz: 7aa2690cfea72e979074ac705f64907be2a3635380b441a80d248c78514de4aa9011ec55380c63da48f71feaedf1b8a4a49cdee92d89eb0fd539f36425da17b5
4
+ data.tar.gz: 72ee667bbbc4ffa3433a16c65cd9878747e913bfd98936bc3e3f462e74de84e8a36a387b52d20666479a88a88a3b72251d73b16fab88e094ea4ba2ad473e2b9f
5
+ SHA1:
6
+ metadata.gz: 32e580b6523cd24dcaf3275b168b972e63e74875
7
+ data.tar.gz: be58b58e9a59066db25604ee453f56bca48e4564
@@ -96,13 +96,15 @@ module Assert
96
96
  end
97
97
 
98
98
  module Random
99
+
100
+ # rand given a max int value returns integers between 0 and max-1
99
101
  def self.integer(max = nil)
100
102
  rand(max || 32_766) + 1
101
103
  end
102
104
 
103
105
  # `rand` with no args gives a float between 0 and 1
104
106
  def self.float(max = nil)
105
- (self.integer((max || 100) - 1) + rand).to_f
107
+ (max || 100).to_f * rand
106
108
  end
107
109
 
108
110
  def self.date_string
@@ -153,6 +155,7 @@ module Assert
153
155
  def self.binary
154
156
  [ self.integer(10000) ].pack('N*')
155
157
  end
158
+
156
159
  end
157
160
 
158
161
  end
@@ -1,3 +1,3 @@
1
1
  module Assert
2
- VERSION = "2.16.1"
2
+ VERSION = "2.16.2"
3
3
  end
@@ -20,7 +20,7 @@ module Assert::Factory
20
20
  end
21
21
 
22
22
  should "allow passing a maximum value using `integer`" do
23
- assert_includes subject.integer(2), [ 1, 2 ]
23
+ assert_includes subject.integer(2), [1, 2]
24
24
  end
25
25
 
26
26
  should "return a random float using `float`" do
@@ -30,7 +30,10 @@ module Assert::Factory
30
30
  should "allow passing a maximum value using `float`" do
31
31
  float = subject.float(2)
32
32
  assert float <= 2
33
- assert float >= 1
33
+ assert float >= 0
34
+
35
+ float = subject.float(0)
36
+ assert_equal 0.0, float
34
37
  end
35
38
 
36
39
  should "return a random date using `date`" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assert
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.16.1
4
+ version: 2.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Redding
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2016-05-31 00:00:00 Z
13
+ date: 2016-08-08 00:00:00 Z
14
14
  dependencies: []
15
15
 
16
16
  description: Assertion style testing framework.