test-unit 3.2.7 → 3.2.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 +5 -5
- data/doc/text/news.md +7 -0
- data/lib/test/unit/ui/console/testrunner.rb +29 -10
- data/lib/test/unit/util/procwrapper.rb +4 -4
- data/lib/test/unit/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2a4feb161fab1f115df6c63a92032e2d96ac85e0a341842b83b91247cf51248d
|
4
|
+
data.tar.gz: 5a51478bd366026b371bc203176a59c20c94692b15f44a50316311a14db2963b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10db186432bc8f15f3c44eef4cfeead4a6621eec2cfdd74e43a2ca3b1de23002b51ca74c8eac6d666f3abc6c3d31a64b825f62ded1481eb6034179784f34846b
|
7
|
+
data.tar.gz: '05079d4f328d0bad66c7473b0a4fe595a9b1a9d3a27e9b0a44e3ec121f67ad33a92ca22ba2ccb2a7a142f24c5160bf4d1fbed1f13b2dd74a5062660e8969cb93'
|
data/doc/text/news.md
CHANGED
@@ -225,27 +225,47 @@ module Test
|
|
225
225
|
end
|
226
226
|
|
227
227
|
def output_fault_backtrace(fault)
|
228
|
-
snippet_is_shown = false
|
229
228
|
detector = FaultLocationDetector.new(fault, @code_snippet_fetcher)
|
230
229
|
backtrace = fault.location
|
231
230
|
# workaround for test-spec. :<
|
232
231
|
# see also GitHub:#22
|
233
232
|
backtrace ||= []
|
234
|
-
|
233
|
+
|
234
|
+
code_snippet_backtrace_index = nil
|
235
|
+
code_snippet_lines = nil
|
235
236
|
backtrace.each_with_index do |entry, i|
|
236
|
-
output(entry)
|
237
|
-
next if snippet_is_shown
|
238
237
|
next unless detector.target?(entry)
|
239
238
|
file, line_number, = detector.split_backtrace_entry(entry)
|
240
|
-
|
241
|
-
|
239
|
+
lines = fetch_code_snippet(file, line_number)
|
240
|
+
unless lines.empty?
|
241
|
+
code_snippet_backtrace_index = i
|
242
|
+
code_snippet_lines = lines
|
243
|
+
break
|
244
|
+
end
|
245
|
+
end
|
246
|
+
|
247
|
+
if @reverse_output
|
248
|
+
backtrace.each_with_index.reverse_each do |entry, i|
|
249
|
+
if i == code_snippet_backtrace_index
|
250
|
+
output_code_snippet(code_snippet_lines, fault_color(fault))
|
251
|
+
end
|
252
|
+
output(entry)
|
253
|
+
end
|
254
|
+
else
|
255
|
+
backtrace.each_with_index do |entry, i|
|
256
|
+
output(entry)
|
257
|
+
if i == code_snippet_backtrace_index
|
258
|
+
output_code_snippet(code_snippet_lines, fault_color(fault))
|
259
|
+
end
|
260
|
+
end
|
242
261
|
end
|
243
262
|
end
|
244
263
|
|
245
|
-
def
|
246
|
-
|
247
|
-
|
264
|
+
def fetch_code_snippet(file, line_number)
|
265
|
+
@code_snippet_fetcher.fetch(file, line_number)
|
266
|
+
end
|
248
267
|
|
268
|
+
def output_code_snippet(lines, target_line_color=nil)
|
249
269
|
max_n = lines.collect {|n, line, attributes| n}.max
|
250
270
|
digits = (Math.log10(max_n) + 1).truncate
|
251
271
|
lines.each do |n, line, attributes|
|
@@ -259,7 +279,6 @@ module Test
|
|
259
279
|
output(" %2s %*d: %s" % [current_line_mark, digits, n, line],
|
260
280
|
line_color)
|
261
281
|
end
|
262
|
-
true
|
263
282
|
end
|
264
283
|
|
265
284
|
def output_failure_message(failure)
|
data/lib/test/unit/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-unit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-05-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: power_assert
|
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
231
|
version: '0'
|
232
232
|
requirements: []
|
233
233
|
rubyforge_project:
|
234
|
-
rubygems_version: 2.
|
234
|
+
rubygems_version: 2.7.6
|
235
235
|
signing_key:
|
236
236
|
specification_version: 4
|
237
237
|
summary: An xUnit family unit testing framework for Ruby.
|