• R/O
  • SSH
  • HTTPS

minitest-cibase: Commit


Commit MetaInfo

Revision20 (tree)
Time2011-11-26 10:25:50
Authortoy_dev

Log Message

Failure が発生した時に表示が崩れる問題を解消した。

Change Summary

Incremental Difference

--- trunk/main/view/minitestresult.rb (revision 19)
+++ trunk/main/view/minitestresult.rb (revision 20)
@@ -63,15 +63,10 @@
6363 end
6464
6565 while error_content.length > 0
66- if /^ [0-9]+\) (Failure|Error):\s+?(.+?)\(.+?\)( \[(.+?)\])?:.*?^(.+)/m =~ error_content
67- test_method = $2
68- test_cls = $3
69- error_line = $4
70- error_content = $5
66+ (matched, test_cls, test_method, error_line, error_content) = __match_failure_or_error(error_content)
67+ if matched then
7168 __set_result(test_source, test_cls, test_method, 'error_line', error_line)
7269
73- STDERR.puts "error_content => #{error_content}"
74-
7570 if /(.+?)(^ [0-9]+\) (Failure|Error):\s+?(.+?)\(.+?\)( \[(.+?)\])?:.*^(.+))/m =~ error_content then
7671 __set_result(test_source, test_cls, test_method, 'error_report', $1)
7772 error_content = $2
@@ -279,6 +274,18 @@
279274 @result[test_source][test_cls][test_method][name] = value
280275 end
281276
277+ def __match_failure_or_error(error_content)
278+ if /^ [0-9]+\) Failure:\s+?(.+?)\((.+?)\) \[(.+?)\]:.*?^(.+)/m =~ error_content then
279+ return [true, $2, $1, $3, $4]
280+ end
281+
282+ if /^ [0-9]+\) Error:\s+?(.+?)\((.+?)\):.*?^(.+)/m =~ error_content then
283+ return [true, $2, $1, nil, $3]
284+ end
285+
286+ return [false, nil, nil, nil]
287+ end
288+
282289 def __encode(content)
283290 if @to_encoding != nil then
284291 if @from_encoding != nil then
Show on old repository browser