sus 0.28.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bbf42a4b39c1c3d893fa9384c9050ab7a5ae94b79484d7e4cd64422fd128f315
4
- data.tar.gz: cd6ff7a16f37f3499fe983bf9ed376a10451297b5a4e368b30c04d11c4b8fc45
3
+ metadata.gz: fb73658184c73da088c57ee5bb4a86834116fdfb31cccf7a7c93248bac9854c1
4
+ data.tar.gz: ba96338fe0a444462b1a1d4d5f2c249b84874a7be4431a0aac395427e3e92cb5
5
5
  SHA512:
6
- metadata.gz: 9445656ad940b6d85db4b3dc2813d1f8b139290877707eb9b8411992a4bd71d0cc2142ab31470b7cbd8a69b1a72bde22e37c6cadf67c83bca9fd8515e9d89ce0
7
- data.tar.gz: 4cd4c7e9a3fc7cdba83b6b74ea8d9b57471b859450fd3534d72ae4adc5a9643f595127c779029315b0662f563c143191598eb5764c8ed0ed838be43a1457c888
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)
@@ -58,10 +59,14 @@ module Sus
58
59
  end
59
60
 
60
61
  def call(assertions, subject)
61
- subject.each_with_index do |value, index|
62
- assertions.nested("[#{index}] = #{value.inspect}") do |assertions|
62
+ index = 0
63
+
64
+ subject.each do |value|
65
+ assertions.nested("[#{index}] = #{value.inspect}", distinct: true) do |assertions|
63
66
  @predicate&.call(assertions, value)
64
67
  end
68
+
69
+ index += 1
65
70
  end
66
71
  end
67
72
  end
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.28.0"
7
+ VERSION = "0.29.1"
8
8
  end
data/readme.md CHANGED
@@ -12,7 +12,7 @@ Non-features:
12
12
  - Flexibility at the expense of performance.
13
13
  - Backwards compatibility.
14
14
 
15
- [![Development Status](https://github.com/ioquatix/sus/workflows/Test/badge.svg)](https://github.com/ioquatix/sus/actions?workflow=Test)
15
+ [![Development Status](https://github.com/sus-rb/sus/workflows/Test/badge.svg)](https://github.com/sus-rb/sus/actions?workflow=Test)
16
16
 
17
17
  ## Ideas
18
18
 
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.28.0
4
+ version: 0.29.1
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: 2024-07-14 00:00:00.000000000 Z
41
+ date: 2024-07-17 00:00:00.000000000 Z
42
42
  dependencies: []
43
43
  description:
44
44
  email:
@@ -101,13 +101,13 @@ files:
101
101
  - lib/sus/with.rb
102
102
  - license.md
103
103
  - readme.md
104
- homepage: https://github.com/ioquatix/sus
104
+ homepage: https://github.com/sus-rb/sus
105
105
  licenses:
106
106
  - MIT
107
107
  metadata:
108
- documentation_uri: https://ioquatix.github.io/sus/
108
+ documentation_uri: https://sus-rb.github.io/sus/
109
109
  funding_uri: https://github.com/sponsors/ioquatix/
110
- source_code_uri: https://github.com/ioquatix/sus.git
110
+ source_code_uri: https://github.com/sus-rb/sus.git
111
111
  post_install_message:
112
112
  rdoc_options: []
113
113
  require_paths:
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubygems_version: 3.5.9
126
+ rubygems_version: 3.5.11
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: A fast and scalable test runner.
metadata.gz.sig CHANGED
Binary file