minitest-utils 0.5.7 → 0.5.8

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: ad42d4b5af4fedb67bd32f1ef6c501c7c1668b2738b06c556a24c66fc739bf29
4
- data.tar.gz: 65415517cbda393258ea30112037d627eb322c0cd5ed641e0a80d76f35e8d4f9
3
+ metadata.gz: 21397dacbcfc6383a5b9c1fe546808df9408702e8836253fc290d5ec970b1759
4
+ data.tar.gz: ac528017206944beee38ce9cba466ad9978d9e16ec927b64c5a34bb7bbaf447a
5
5
  SHA512:
6
- metadata.gz: 53fc67af42f5149f0c79d9c80d9427ce0779ac4f4f3bd456f030e47b2cc3f812c70c248ae5d9352dbb41e7d3aa99ebda5135b2593b078c4b308e9964df2e2984
7
- data.tar.gz: 96cc057b759be11e2b84e732b277d3fc8e1a965ee4cbb7d35898938bbdd44da74a78794dadb960d7104508c7968a3dfbce99a62fc39a8c01860d495bbff2ed96
6
+ metadata.gz: 7bb1a97708504fc146d9d84a7b20d4e7c5cbefce960eabc57add36e72b219da18597566b932a936b528bf6ce0880a8a3dc54b67cd77a02323b9fd3e02fe9c374
7
+ data.tar.gz: 5ac9e8d3e430f946126c877c1f029a5e0761651b4680b7ef096a2140fe55cbedc284f1e428d310160b8f561001dcc44e287e77537ba36e4666265c4e0f1eb05d
@@ -140,25 +140,38 @@ module Minitest
140
140
  message = result.failure.message
141
141
  message = message.lines.tap(&:pop).join.chomp if result.error?
142
142
 
143
+ test = find_test_info(result)
144
+
143
145
  output = ["\n\n"]
144
- output << color(format("%4d) %s", index, result_name(result.name)))
146
+ output << color(format("%4d) %s", index, test[:description]))
145
147
  output << "\n" << color(indent(message), :red)
146
148
  output << "\n" << color(backtrace, :blue)
147
149
  io.print output.join
148
150
  end
149
151
 
150
152
  private def display_skipped(result, index)
151
- location = location(result.failure.location)
153
+ location = filter_backtrace(
154
+ result
155
+ .failure
156
+ .backtrace_locations
157
+ .map {|l| [l.path, l.lineno].join(":") }
158
+ ).first
159
+
160
+ location, line = location.to_s.split(":")
161
+ location = Pathname(location).relative_path_from(Pathname.pwd)
162
+ location = "#{location}:#{line}"
163
+
164
+ test = find_test_info(result)
152
165
  output = ["\n\n"]
153
166
  output << color(
154
- format("%4d) %s [SKIPPED]", index, result_name(result.name)), :yellow
167
+ format("%4d) %s [SKIPPED]", index, test[:description]), :yellow
155
168
  )
156
169
  output << "\n" << indent(color(location, :yellow))
157
170
  io.print output.join
158
171
  end
159
172
 
160
173
  private def display_replay_command(result)
161
- test = find_test_file(result)
174
+ test = find_test_info(result)
162
175
  return if test[:source_location].empty?
163
176
 
164
177
  command = build_test_command(test, result)
@@ -169,7 +182,7 @@ module Minitest
169
182
  io.print output.join
170
183
  end
171
184
 
172
- private def find_test_file(result)
185
+ private def find_test_info(result)
173
186
  Test.tests.fetch("#{result.klass}##{result.name}")
174
187
  end
175
188
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Minitest
4
4
  module Utils
5
- VERSION = "0.5.7"
5
+ VERSION = "0.5.8"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-11 00:00:00.000000000 Z
10
+ date: 2025-03-14 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: benchmark
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  - !ruby/object:Gem::Version
177
177
  version: '0'
178
178
  requirements: []
179
- rubygems_version: 3.6.4
179
+ rubygems_version: 3.6.2
180
180
  specification_version: 4
181
181
  summary: Some utilities for your Minitest day-to-day usage.
182
182
  test_files: []