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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97dcdf49dd86b82c62193f72bb232f37cfa8e8046b84d42e592c7299cf215678
4
- data.tar.gz: 5b16f6f571348f0688fb8365433f20ba142b47373e93898fd1f1ad9e5749d3da
3
+ metadata.gz: 429759d74415135b8167fe2c08f42100e71db076c1935224295aa8f0a1d4f2de
4
+ data.tar.gz: eae2b813dd229d5c1e6cdeb4dd26fa43bf622e09759d76d12914e48011a48b14
5
5
  SHA512:
6
- metadata.gz: c505c432de946e79b37c461daf9ac3204758adf1f04fcd579d55d15d85522e480d21c933864ebbb4382e003f87f740ee651b57eb65340cb0cc7b82210d52a709
7
- data.tar.gz: 1f9073050a320ee5faa7ae37f73714b8ff76bc9b51c47572b2dd6105a2bc6a491d90ac5980a9b9d11cafe43cd334c15fb9dbadd9d1694f04b35a408aa7dfa095
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
- hash['exception']['file' ] = code(exception).file
279
- hash['exception']['line' ] = code(exception).line
280
- hash['exception']['source' ] = code(exception).to_str
281
- hash['exception']['snippet' ] = code(exception).to_omap
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
@@ -6,7 +6,7 @@ $RUBY_IGNORE_CALLERS = [] unless defined?($RUBY_IGNORE_CALLERS)
6
6
  require 'ansi/core'
7
7
 
8
8
  module Test
9
- VERSION = '0.11.0'
9
+ VERSION = '0.11.1'
10
10
  end
11
11
 
12
12
  require_relative 'rubytest/core_ext'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubytest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trans