sus 0.22.2 → 0.23.0
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/sus/assertions.rb +2 -8
- data/lib/sus/be_within.rb +4 -2
- data/lib/sus/have.rb +6 -2
- data/lib/sus/have_duration.rb +1 -3
- data/lib/sus/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9e2b0cb3a0b9f4a5c3f32729a13f5f29935108f5a3606afe3a6189d1c58e2ed
|
4
|
+
data.tar.gz: a7a637715ff6a75f6bb6d1bd1bf2e536c1211c5eb304c7ea045797d68ab9d90b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7ba7d839d58bd10e22cb331685f5c5d3428227f36151d19a0c40a80362f5b7e71d3a063d80258df5bb6e7cb3f21755e43ebfca7c455541a73deb83172a35590
|
7
|
+
data.tar.gz: 3c77ddc24a627492904209fe84b4b4ca93c03c368b63607306fe4d9a58c8e41b99dabf580579dbbac31e61afcaec8f5cc91f834aa26bc4f15e80bf5ba08e92a5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/sus/assertions.rb
CHANGED
@@ -192,16 +192,10 @@ module Sus
|
|
192
192
|
|
193
193
|
if condition
|
194
194
|
@passed << assert
|
195
|
-
|
196
|
-
if !@orientation || @verbose
|
197
|
-
@output.assert(condition, @orientation, message || "assertion passed", backtrace)
|
198
|
-
end
|
195
|
+
@output.assert(condition, @orientation, message || "assertion passed", backtrace)
|
199
196
|
else
|
200
197
|
@failed << assert
|
201
|
-
|
202
|
-
if @orientation || @verbose
|
203
|
-
@output.assert(condition, @orientation, message || "assertion failed", backtrace)
|
204
|
-
end
|
198
|
+
@output.assert(condition, @orientation, message || "assertion failed", backtrace)
|
205
199
|
end
|
206
200
|
end
|
207
201
|
|
data/lib/sus/be_within.rb
CHANGED
@@ -16,7 +16,7 @@ module Sus
|
|
16
16
|
|
17
17
|
def call(assertions, subject)
|
18
18
|
assertions.nested(self) do |assertions|
|
19
|
-
assertions.assert(@range.include?(subject)
|
19
|
+
assertions.assert(@range.include?(subject))
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -32,7 +32,9 @@ module Sus
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def percent_of(value)
|
35
|
-
|
35
|
+
tolerance = Rational(@tolerance, 100)
|
36
|
+
|
37
|
+
return Bounded.new(Range.new(value - value * tolerance, value + value * tolerance))
|
36
38
|
end
|
37
39
|
|
38
40
|
def print(output)
|
data/lib/sus/have.rb
CHANGED
@@ -21,7 +21,9 @@ module Sus
|
|
21
21
|
def call(assertions, subject)
|
22
22
|
assertions.nested(self) do |assertions|
|
23
23
|
assertions.assert(subject.key?(@name), "has key")
|
24
|
-
@predicate
|
24
|
+
if @predicate
|
25
|
+
Expect.new(assertions, subject[@name]).to(@predicate)
|
26
|
+
end
|
25
27
|
end
|
26
28
|
end
|
27
29
|
end
|
@@ -39,7 +41,9 @@ module Sus
|
|
39
41
|
def call(assertions, subject)
|
40
42
|
assertions.nested(self) do |assertions|
|
41
43
|
assertions.assert(subject.respond_to?(@name), "has attribute")
|
42
|
-
@predicate
|
44
|
+
if @predicate
|
45
|
+
Expect.new(assertions, subject.send(@name)).to(@predicate)
|
46
|
+
end
|
43
47
|
end
|
44
48
|
end
|
45
49
|
end
|
data/lib/sus/have_duration.rb
CHANGED
data/lib/sus/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -38,7 +38,7 @@ cert_chain:
|
|
38
38
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
39
39
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
40
40
|
-----END CERTIFICATE-----
|
41
|
-
date: 2023-08-
|
41
|
+
date: 2023-08-22 00:00:00.000000000 Z
|
42
42
|
dependencies: []
|
43
43
|
description:
|
44
44
|
email:
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
|
-
rubygems_version: 3.4.
|
124
|
+
rubygems_version: 3.4.7
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: A fast and scalable test runner.
|
metadata.gz.sig
CHANGED
Binary file
|