sus 0.15.0 → 0.15.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/bin/sus +1 -1
- data/bin/sus-parallel +1 -1
- data/lib/sus/assertions.rb +39 -13
- data/lib/sus/be.rb +3 -1
- data/lib/sus/config.rb +15 -7
- data/lib/sus/output.rb +3 -2
- data/lib/sus/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- 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: 83bf82adb70fa074a1f303a612403523b64317dc0bc780432a46c1babe5e853b
|
4
|
+
data.tar.gz: bc6e9c2f98c527fb09ca5b2a0b6cb3c977f42d1cf4a287bd956fa33576b2d443
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9865aac49407ff145daf5bc98ec83b3d3f63fb4ea06b483ff0713cfb25966443191f40c47990ea3bfd928248f9dcce70ebdbb522ad57ed46029e7b7304d9de59
|
7
|
+
data.tar.gz: fea67b00c8999565b4a6d3e08dad67a3e4132172d6ee40d2b3c93fd37b7135cb410d95fe5ba79a779cbc5d00ec99ec4aae44024bfba1e0de08860f408859e93d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/bin/sus
CHANGED
data/bin/sus-parallel
CHANGED
data/lib/sus/assertions.rb
CHANGED
@@ -35,6 +35,8 @@ module Sus
|
|
35
35
|
@passed = Array.new
|
36
36
|
@failed = Array.new
|
37
37
|
@deferred = Array.new
|
38
|
+
@skipped = Array.new
|
39
|
+
@errored = Array.new
|
38
40
|
|
39
41
|
@count = 0
|
40
42
|
end
|
@@ -63,15 +65,18 @@ module Sus
|
|
63
65
|
# Nested assertions have been deferred.
|
64
66
|
attr :deferred
|
65
67
|
|
68
|
+
attr :skipped
|
69
|
+
attr :errored
|
70
|
+
|
66
71
|
# The total number of assertions performed:
|
67
72
|
attr :count
|
68
73
|
|
69
74
|
def inspect
|
70
|
-
"\#<#{self.class} #{@passed.size} passed #{@failed.size} failed #{@deferred.size} deferred>"
|
75
|
+
"\#<#{self.class} #{@passed.size} passed #{@failed.size} failed #{@deferred.size} deferred #{@skipped.size} skipped #{@errored.size} errored>"
|
71
76
|
end
|
72
77
|
|
73
78
|
def total
|
74
|
-
@passed.size + @failed.size
|
79
|
+
@passed.size + @failed.size + @deferred.size + @skipped.size + @errored.size
|
75
80
|
end
|
76
81
|
|
77
82
|
def print(output, verbose: @verbose)
|
@@ -95,6 +100,14 @@ module Sus
|
|
95
100
|
output.write(:deferred, @deferred.size, " deferred", :reset, " ")
|
96
101
|
end
|
97
102
|
|
103
|
+
if @skipped.any?
|
104
|
+
output.write(:skipped, @skipped.size, " skipped", :reset, " ")
|
105
|
+
end
|
106
|
+
|
107
|
+
if @errored.any?
|
108
|
+
output.write(:errored, @errored.size, " errored", :reset, " ")
|
109
|
+
end
|
110
|
+
|
98
111
|
output.write("out of ", self.total, " total (", @count, " assertions)")
|
99
112
|
end
|
100
113
|
end
|
@@ -104,16 +117,16 @@ module Sus
|
|
104
117
|
end
|
105
118
|
|
106
119
|
def empty?
|
107
|
-
@passed.empty? and @failed.empty?
|
120
|
+
@passed.empty? and @failed.empty? and @deferred.empty? and @skipped.empty? and @errored.empty?
|
108
121
|
end
|
109
122
|
|
110
123
|
def passed?
|
111
124
|
if @inverted
|
112
125
|
# Inverted assertions:
|
113
|
-
|
126
|
+
@failed.any? and @errored.empty?
|
114
127
|
else
|
115
128
|
# Normal assertions:
|
116
|
-
|
129
|
+
@failed.empty? and @errored.empty?
|
117
130
|
end
|
118
131
|
end
|
119
132
|
|
@@ -121,6 +134,10 @@ module Sus
|
|
121
134
|
!self.passed?
|
122
135
|
end
|
123
136
|
|
137
|
+
def errored?
|
138
|
+
@errored.any?
|
139
|
+
end
|
140
|
+
|
124
141
|
def assert(condition, message = nil)
|
125
142
|
@count += 1
|
126
143
|
|
@@ -140,7 +157,8 @@ module Sus
|
|
140
157
|
end
|
141
158
|
|
142
159
|
def skip(reason)
|
143
|
-
@output.puts(:indent, :
|
160
|
+
@output.puts(:indent, :skipped, skip_prefix, reason)
|
161
|
+
@skipped << self
|
144
162
|
end
|
145
163
|
|
146
164
|
def inform(message)
|
@@ -166,15 +184,15 @@ module Sus
|
|
166
184
|
end
|
167
185
|
end
|
168
186
|
|
169
|
-
def
|
170
|
-
@
|
187
|
+
def error!(error)
|
188
|
+
@errored << self
|
171
189
|
|
172
190
|
lines = error.message.split(/\r?\n/)
|
173
191
|
|
174
|
-
@output.puts(:indent, *
|
192
|
+
@output.puts(:indent, *error_prefix, error.class, ": ", lines.shift)
|
175
193
|
|
176
194
|
lines.each do |line|
|
177
|
-
@output.puts(:indent,
|
195
|
+
@output.puts(:indent, line)
|
178
196
|
end
|
179
197
|
|
180
198
|
@output.write(Output::Backtrace.for(error, @identity))
|
@@ -205,7 +223,7 @@ module Sus
|
|
205
223
|
begin
|
206
224
|
result = yield(assertions)
|
207
225
|
rescue StandardError => error
|
208
|
-
assertions.
|
226
|
+
assertions.error!(error)
|
209
227
|
end
|
210
228
|
end
|
211
229
|
|
@@ -255,7 +273,9 @@ module Sus
|
|
255
273
|
def merge!(assertions)
|
256
274
|
@count += assertions.count
|
257
275
|
|
258
|
-
if assertions.
|
276
|
+
if assertions.errored?
|
277
|
+
@errored << assertions
|
278
|
+
elsif assertions.passed?
|
259
279
|
@passed << assertions
|
260
280
|
|
261
281
|
# if @verbose
|
@@ -277,6 +297,8 @@ module Sus
|
|
277
297
|
@passed.concat(assertions.passed)
|
278
298
|
@failed.concat(assertions.failed)
|
279
299
|
@deferred.concat(assertions.deferred)
|
300
|
+
@skipped.concat(assertions.skipped)
|
301
|
+
@errored.concat(assertions.errored)
|
280
302
|
|
281
303
|
# if @verbose
|
282
304
|
# @output.write(:indent)
|
@@ -309,7 +331,11 @@ module Sus
|
|
309
331
|
end
|
310
332
|
|
311
333
|
def skip_prefix
|
312
|
-
"
|
334
|
+
"⏸ "
|
335
|
+
end
|
336
|
+
|
337
|
+
def error_prefix
|
338
|
+
[:errored, "⚠ "]
|
313
339
|
end
|
314
340
|
end
|
315
341
|
end
|
data/lib/sus/be.rb
CHANGED
data/lib/sus/config.rb
CHANGED
@@ -116,13 +116,13 @@ module Sus
|
|
116
116
|
|
117
117
|
assertions.print(output)
|
118
118
|
output.puts
|
119
|
-
|
119
|
+
|
120
120
|
print_finished_statistics(assertions)
|
121
|
-
|
121
|
+
|
122
122
|
if !partial? and assertions.passed?
|
123
123
|
print_test_feedback(assertions)
|
124
124
|
end
|
125
|
-
|
125
|
+
|
126
126
|
print_slow_tests(assertions)
|
127
127
|
print_failed_assertions(assertions)
|
128
128
|
end
|
@@ -193,14 +193,22 @@ module Sus
|
|
193
193
|
end
|
194
194
|
end
|
195
195
|
|
196
|
-
def
|
197
|
-
if assertions.
|
196
|
+
def print_assertions(title, assertions)
|
197
|
+
if assertions.any?
|
198
198
|
output.puts
|
199
|
+
output.puts title
|
199
200
|
|
200
|
-
assertions.
|
201
|
-
|
201
|
+
assertions.each do |assertion|
|
202
|
+
assertions.each do |failure|
|
203
|
+
output.append(failure.output)
|
204
|
+
end
|
202
205
|
end
|
203
206
|
end
|
204
207
|
end
|
208
|
+
|
209
|
+
def print_failed_assertions(assertions)
|
210
|
+
print_assertions("🤔 Failed assertions:", assertions.failed)
|
211
|
+
print_assertions("🔥 Errored assertions:", assertions.errored)
|
212
|
+
end
|
205
213
|
end
|
206
214
|
end
|
data/lib/sus/output.rb
CHANGED
@@ -39,8 +39,9 @@ module Sus
|
|
39
39
|
|
40
40
|
output[:passed] = output.style(:green)
|
41
41
|
output[:failed] = output.style(:red)
|
42
|
-
output[:
|
43
|
-
output[:
|
42
|
+
output[:deferred] = output.style(:yellow)
|
43
|
+
output[:skipped] = output.style(:blue)
|
44
|
+
output[:errored] = output.style(:red)
|
44
45
|
# output[:inform] = output.style(nil, nil, :bold)
|
45
46
|
|
46
47
|
return output
|
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.15.
|
4
|
+
version: 0.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
38
38
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
39
39
|
-----END CERTIFICATE-----
|
40
|
-
date: 2022-
|
40
|
+
date: 2022-12-04 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: bake-test
|
metadata.gz.sig
CHANGED
Binary file
|