sus 0.29.0 → 0.29.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ec538e7cbf293f075dd262e212e705edc33d457e4791458d5d75a3179cfca2f
4
- data.tar.gz: 6193fb56afb1124b67d5ecf44f646f71a97919c8924c7d6dbc586ed4e566c843
3
+ metadata.gz: fb73658184c73da088c57ee5bb4a86834116fdfb31cccf7a7c93248bac9854c1
4
+ data.tar.gz: ba96338fe0a444462b1a1d4d5f2c249b84874a7be4431a0aac395427e3e92cb5
5
5
  SHA512:
6
- metadata.gz: 8b537a93be3bc1f008cee17659df931a04f9f1bcbc219d2813543ba4372c479d9f56b6de5d9aae1fca4179beab095450789fd7f046e89d1d6509921cb2eafab1
7
- data.tar.gz: a4c27583848df35d4c40c95c73f128d7521b05856b14c50b80f094637d4f850ea44e32f0fd917f40a48603a1e6ede1bf83772a0bdeb4f5918da51d9fb8a1ac0d
6
+ metadata.gz: 9f6469a0c7d2168a11cf3da899e348db511fba9a019fff95a28079ad0b4fb21639fb14a0883f59d69b4fe992aa326b6a58917b05470ed513ae713b0f9b0340dd
7
+ data.tar.gz: 81282c2660c353a69d38800e70386fdba27a8f8221d522967a66d442a9be1692c75340c75f4a3bf14b0f774bc8367c5a2f5ac43e281cf01112b4d31d0f232782
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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 taht 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.
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.nested(self) do |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
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2021-2024, by Samuel Williams.
5
5
 
6
6
  module Sus
7
- VERSION = "0.29.0"
7
+ VERSION = "0.29.1"
8
8
  end
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.29.0
4
+ version: 0.29.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file