rubytest 0.11.0 → 0.11.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
- data/HISTORY.md +13 -0
- data/demo/05_builtin_reporters.md +20 -0
- data/lib/rubytest/format/abstract_hash.rb +8 -4
- data/lib/rubytest.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 429759d74415135b8167fe2c08f42100e71db076c1935224295aa8f0a1d4f2de
|
|
4
|
+
data.tar.gz: eae2b813dd229d5c1e6cdeb4dd26fa43bf622e09759d76d12914e48011a48b14
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 526daa4c7ea189e1b90aec1ad044ca3d04f687dd93560a4355e45de14c036dc2cad92059fabb9673163cf8d1af38eb9f462cdc91a13c4f1b86e40645a691932b
|
|
7
|
+
data.tar.gz: e6f28deb96beae66e9e5b8d4863f51b5cf4bb661c54e4c33a50dc69e86ac1c405b11b80e9d45a0d0ff20e6f4554dee55a0fcf145222db803f513b77e50123a5c
|
data/HISTORY.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# RELEASE HISTORY
|
|
2
2
|
|
|
3
|
+
## 0.11.1 / 2026-11-20
|
|
4
|
+
|
|
5
|
+
Fixes a crash in the TAP-Y and TAP-J reporters.
|
|
6
|
+
|
|
7
|
+
Changes:
|
|
8
|
+
|
|
9
|
+
* Fix the TAP-Y and TAP-J reporters, which raised NoMethodError
|
|
10
|
+
("undefined method 'file' for nil") for a failed, errored or pending test
|
|
11
|
+
whose exception had no backtrace line outside the test framework. Lemon
|
|
12
|
+
marks a test pending that way when it doesn't call the method it covers.
|
|
13
|
+
The run then ended early with wrong counts. The record now has the
|
|
14
|
+
exception's message without a source location.
|
|
15
|
+
|
|
3
16
|
## 0.11.0 / 2026-11-17
|
|
4
17
|
|
|
5
18
|
The Rake task and the HTML reporter are back in Rubytest, so rubytest-rake
|
|
@@ -104,6 +104,26 @@ YAML documents, TAP-J a line of JSON for each record.
|
|
|
104
104
|
records.count { |record| record['type'] == 'case' && !record['status'] }.assert == 2
|
|
105
105
|
end
|
|
106
106
|
|
|
107
|
+
An exception may have no line of backtrace outside the test framework, as
|
|
108
|
+
when a framework marks a test pending itself. Its record then has the message
|
|
109
|
+
without a source location.
|
|
110
|
+
|
|
111
|
+
bare = probe_type.new('bare') do
|
|
112
|
+
error = NotImplementedError.new('not tested')
|
|
113
|
+
error.set_backtrace([])
|
|
114
|
+
raise error
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
readers.each do |format, read|
|
|
118
|
+
success, output, report = render.call(format, [bare, passing])
|
|
119
|
+
records = read.call(output)
|
|
120
|
+
records.last['counts']['total'].assert == 2
|
|
121
|
+
record = records.find { |r| r['label'] == 'bare' }
|
|
122
|
+
record['status'].assert == 'todo'
|
|
123
|
+
record['exception']['message'].assert == 'not tested'
|
|
124
|
+
record['exception'].key?('file').assert == false
|
|
125
|
+
end
|
|
126
|
+
|
|
107
127
|
A TAP-Y stream ends with the YAML end-of-document marker.
|
|
108
128
|
|
|
109
129
|
render.call('tapy')[1].lines.last.chomp.assert == '...'
|
|
@@ -275,10 +275,14 @@ module Test::Reporters
|
|
|
275
275
|
# Add exception subsection of hash.
|
|
276
276
|
def merge_exception(hash, test, exception, bt=false)
|
|
277
277
|
hash['exception'] = {}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
# There is no snippet when every line of the backtrace belongs to
|
|
279
|
+
# the test framework, or the exception has none.
|
|
280
|
+
if snippet = code(exception)
|
|
281
|
+
hash['exception']['file' ] = snippet.file
|
|
282
|
+
hash['exception']['line' ] = snippet.line
|
|
283
|
+
hash['exception']['source' ] = snippet.to_str
|
|
284
|
+
hash['exception']['snippet' ] = snippet.to_omap
|
|
285
|
+
end
|
|
282
286
|
hash['exception']['message' ] = exception.message
|
|
283
287
|
hash['exception']['backtrace'] = clean_backtrace(exception) if bt
|
|
284
288
|
if @current_result && @current_result.exceptions.size > 1
|
data/lib/rubytest.rb
CHANGED