sus 0.29.0 → 0.29.1
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 +1 -1
- data/lib/sus/have.rb +4 -3
- data/lib/sus/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: fb73658184c73da088c57ee5bb4a86834116fdfb31cccf7a7c93248bac9854c1
|
4
|
+
data.tar.gz: ba96338fe0a444462b1a1d4d5f2c249b84874a7be4431a0aac395427e3e92cb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f6469a0c7d2168a11cf3da899e348db511fba9a019fff95a28079ad0b4fb21639fb14a0883f59d69b4fe992aa326b6a58917b05470ed513ae713b0f9b0340dd
|
7
|
+
data.tar.gz: 81282c2660c353a69d38800e70386fdba27a8f8221d522967a66d442a9be1692c75340c75f4a3bf14b0f774bc8367c5a2f5ac43e281cf01112b4d31d0f232782
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/sus/assertions.rb
CHANGED
@@ -60,7 +60,7 @@ module Sus
|
|
60
60
|
# The absolute orientation of this set of assertions, i.e. whether the assertions are expected to pass or fail regardless of the parent. Used for correctly formatting the output.
|
61
61
|
attr :orientation
|
62
62
|
|
63
|
-
# Whether this set of assertions is isolated from the parent. This is used to ensure
|
63
|
+
# Whether this set of assertions is isolated from the parent. This is used to ensure that any deferred assertions are competed before the parent is completed. This is used by `receive` assertions which are deferred until the user code of the test has completed.
|
64
64
|
attr :isolated
|
65
65
|
|
66
66
|
# Distinct is used to identify a set of assertions as a single statement for the purpose of user feedback. It's used by top level ensure statements to ensure that error messages are captured and reported on those statements.
|
data/lib/sus/have.rb
CHANGED
@@ -19,7 +19,8 @@ module Sus
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def call(assertions, subject)
|
22
|
-
assertions
|
22
|
+
# We want to group all the assertions in to a distinct group:
|
23
|
+
assertions.nested(self, distinct: true) do |assertions|
|
23
24
|
assertions.assert(subject.key?(@name), "has key")
|
24
25
|
if @predicate
|
25
26
|
Expect.new(assertions, subject[@name]).to(@predicate)
|
@@ -39,7 +40,7 @@ module Sus
|
|
39
40
|
end
|
40
41
|
|
41
42
|
def call(assertions, subject)
|
42
|
-
assertions.nested(self) do |assertions|
|
43
|
+
assertions.nested(self, distinct: true) do |assertions|
|
43
44
|
assertions.assert(subject.respond_to?(@name), "has attribute")
|
44
45
|
if @predicate
|
45
46
|
Expect.new(assertions, subject.public_send(@name)).to(@predicate)
|
@@ -61,7 +62,7 @@ module Sus
|
|
61
62
|
index = 0
|
62
63
|
|
63
64
|
subject.each do |value|
|
64
|
-
assertions.nested("[#{index}] = #{value.inspect}") do |assertions|
|
65
|
+
assertions.nested("[#{index}] = #{value.inspect}", distinct: true) do |assertions|
|
65
66
|
@predicate&.call(assertions, value)
|
66
67
|
end
|
67
68
|
|
data/lib/sus/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|