sus 0.20.0 → 0.20.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
2
  SHA256:
3
- metadata.gz: 32d3a31b1ef9a5f80523b6d3bbe34d8fe1312fbee9f48b96eff16ee0c7755b46
4
- data.tar.gz: 7fe132541184eb203cd93f1bb5f94288c473a70d0329b1a351d7bd70be382e41
3
+ metadata.gz: abff2f6428b5b2a3b86b3ad54d32d73f9b78bf58cd1f81bf010cc7593e1c4bc2
4
+ data.tar.gz: 4fb6c173ac38b1c2e2053867d7f8ec768a9cfdd90ddfa8db366ef4af799a3211
5
5
  SHA512:
6
- metadata.gz: 451fa9e5cc095f4af36347f0fc5f55ffbd74ce1b03efa6985cacbcdd2aa469ec577aadc8c6fe4d197e7f323bdd7ae18ca318c2cc1861568abe2b1230525a078f
7
- data.tar.gz: 6d9ae7c5173b87ac726f3e61b13ae3ca199adf73cb86bba9f9e2326cacc064ea395a692288d97a3898fb7ff7500ad8581303a8d3331813fd8bfd04c3665a0da6
6
+ metadata.gz: 23f742731558ca0bb9b3a2a09bc3fb01a6f5d8fb2af4309c41d750866f3e3a9f25be059f1c186670132b1eeafb7896d40262cec04c20d0f8c41e2b73b9255136
7
+ data.tar.gz: e1e4ba8a789c2ca7c1c8391e975499185a0860afc738c3fc0b94dc380c3d22434daef20a0992a07179740f5568afb88a0dda4ef97c1485e96af56ac67d2cce57
checksums.yaml.gz.sig CHANGED
Binary file
@@ -147,13 +147,13 @@ module Sus
147
147
  end
148
148
 
149
149
  class Assert
150
- def initialize(identity, message)
150
+ def initialize(identity, assertions)
151
151
  @identity = identity
152
- @message = message
152
+ @assertions = assertions
153
153
  end
154
154
 
155
155
  attr :identity
156
- attr :message
156
+ attr :assertions
157
157
 
158
158
  def each_failure(&block)
159
159
  yield self
@@ -161,7 +161,7 @@ module Sus
161
161
 
162
162
  def message
163
163
  {
164
- text: @message,
164
+ text: assertions.output.string,
165
165
  location: @identity&.to_location
166
166
  }
167
167
  end
@@ -170,21 +170,20 @@ module Sus
170
170
  def assert(condition, message = nil)
171
171
  @count += 1
172
172
 
173
- message ||= self.output.string
174
173
  backtrace = Output::Backtrace.first(@identity)
175
174
  identity = @identity&.scoped
176
175
 
177
176
  if condition
178
- @passed << Assert.new(identity, message)
177
+ @passed << Assert.new(identity, self)
179
178
 
180
179
  if !@orientation || @verbose
181
- @output.puts(:indent, *pass_prefix, message, backtrace)
180
+ @output.puts(:indent, *pass_prefix, message || "assertion passed", backtrace)
182
181
  end
183
182
  else
184
- @failed << Assert.new(identity, message)
183
+ @failed << Assert.new(identity, self)
185
184
 
186
185
  if @orientation || @verbose
187
- @output.puts(:indent, *fail_prefix, message, backtrace)
186
+ @output.puts(:indent, *fail_prefix, message || "assertion failed", backtrace)
188
187
  end
189
188
  end
190
189
  end
@@ -26,7 +26,7 @@ module Sus
26
26
  rescue @exception_class => exception
27
27
  # Did it have the right message?
28
28
  if @message
29
- @message.call(assertions, exception.message)
29
+ Expect.new(assertions, exception.message).to(@message)
30
30
  else
31
31
  assertions.assert(true, "raised")
32
32
  end
data/lib/sus/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2021-2022, by Samuel Williams.
5
5
 
6
6
  module Sus
7
- VERSION = "0.20.0"
7
+ VERSION = "0.20.2"
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.20.0
4
+ version: 0.20.2
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-02-24 00:00:00.000000000 Z
41
+ date: 2023-03-01 00:00:00.000000000 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: bake-test
metadata.gz.sig CHANGED
Binary file