test-unit 3.2.7 → 3.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 906aaf6d18c456041612ba02dfe0eeff56be81f4
4
- data.tar.gz: 4d065ef6b4db8517994d6f3a5a6342e1051e51e5
2
+ SHA256:
3
+ metadata.gz: 2a4feb161fab1f115df6c63a92032e2d96ac85e0a341842b83b91247cf51248d
4
+ data.tar.gz: 5a51478bd366026b371bc203176a59c20c94692b15f44a50316311a14db2963b
5
5
  SHA512:
6
- metadata.gz: f2b1f9bc3236ad6c7cb9bb59d67d209bab5faab09fa6d4eb3f4f4b76f25e6548c66078ed6d59504048dd5070921b34c10d35d5e93a190f3cebd679df910f7ec1
7
- data.tar.gz: d30651032f9f04967d694fb75071ad4e1c42d66ceb8e00d79aa09fe310682cb7ed811bf00a8cee4a9a164546b8c98c79e8cdca5cf98475050c3b8148be7b5909
6
+ metadata.gz: 10db186432bc8f15f3c44eef4cfeead4a6621eec2cfdd74e43a2ca3b1de23002b51ca74c8eac6d666f3abc6c3d31a64b825f62ded1481eb6034179784f34846b
7
+ data.tar.gz: '05079d4f328d0bad66c7473b0a4fe595a9b1a9d3a27e9b0a44e3ec121f67ad33a92ca22ba2ccb2a7a142f24c5160bf4d1fbed1f13b2dd74a5062660e8969cb93'
@@ -1,5 +1,12 @@
1
1
  # News
2
2
 
3
+ ## 3.2.8 - 2018-05-13 {#version-3-2-8}
4
+
5
+ ### Improvements
6
+
7
+ * [UI][console]: Changed to put code snippet before backtrace on
8
+ reverse mode.
9
+
3
10
  ## 3.2.7 - 2017-12-12 {#version-3-2-7}
4
11
 
5
12
  ### Improvements
@@ -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
- backtrace = backtrace.reverse if @reverse_output
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
- snippet_is_shown = output_code_snippet(file, line_number,
241
- fault_color(fault))
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 output_code_snippet(file, line_number, target_line_color=nil)
246
- lines = @code_snippet_fetcher.fetch(file, line_number)
247
- return false if lines.empty?
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)
@@ -31,10 +31,10 @@ module Test
31
31
 
32
32
  def ==(other)
33
33
  case(other)
34
- when ProcWrapper
35
- return @a_proc == other.to_proc
36
- else
37
- return super
34
+ when ProcWrapper
35
+ return @a_proc == other.to_proc
36
+ else
37
+ return super
38
38
  end
39
39
  end
40
40
  alias :eql? :==
@@ -1,5 +1,5 @@
1
1
  module Test
2
2
  module Unit
3
- VERSION = "3.2.7"
3
+ VERSION = "3.2.8"
4
4
  end
5
5
  end
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.7
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: 2017-12-11 00:00:00.000000000 Z
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.5.2.1
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.