minitest-reporters 1.2.0.beta1 → 1.2.0.beta2
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
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62f787588456a19e8d7f3c259964eb08bb800cb6
|
4
|
+
data.tar.gz: 57f0b830502a46809f639a0000ac6b465c94163f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 850a2e0aa57a50ff1603f4d4aab3904aa57a93eef0d126080879ce8fdac468d1c2dc95df58d1844387af3d79d10398c93653212390b2c5731587a7d8a175ebc3
|
7
|
+
data.tar.gz: 7ee01ec3c6f529936d5d762c833980b45758d70b0b34321cb3f8a9a10dd2f48479c2ff674128d7c3cfc81faac330097e5c2eef494d6215b922712a65fd143097
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
### [v1.2.0.beta2](https://github.com/kern/minitest-reporters/compare/v1.2.0.beta1...v1.2.0.beta2)
|
2
|
+
|
3
|
+
* fixed uninitialized time in junit reporter [#251](https://github.com/kern/minitest-reporters/issues/251)
|
4
|
+
* format option added to progress reporter [#240](https://github.com/kern/minitest-reporters/pull/240) (contributed by [jorgesmu](https://github.com/jorgesmu))
|
5
|
+
* improved output of junit reporter [#245](https://github.com/kern/minitest-reporters/pull/245) (contributed by [jules2689](https://github.com/jules2689))
|
6
|
+
|
1
7
|
### [1.2.0.beta1](https://github.com/kern/minitest-reporters/compare/v1.1.19...v1.2.0.beta1)
|
2
8
|
|
3
9
|
* SpecReporter regression for Minitest 5.11.1 fixed [#250](https://github.com/kern/minitest-reporters/pull/250) (contrinuted by [mbround18](https://github.com/mbround18))
|
@@ -13,6 +13,7 @@ module Minitest
|
|
13
13
|
super({})
|
14
14
|
@reports_path = File.absolute_path(reports_dir)
|
15
15
|
@single_file = options[:single_file]
|
16
|
+
@base_path = options[:base_path] || Dir.pwd
|
16
17
|
|
17
18
|
if empty
|
18
19
|
puts "Emptying #{@reports_path}"
|
@@ -28,33 +29,46 @@ module Minitest
|
|
28
29
|
suites = tests.group_by(&:class)
|
29
30
|
|
30
31
|
if @single_file
|
31
|
-
|
32
|
+
xml = Builder::XmlMarkup.new(:indent => 2)
|
33
|
+
xml.instruct!
|
34
|
+
xml.test_suites do
|
35
|
+
suites.each do |suite, tests|
|
36
|
+
parse_xml_for(xml, suite, tests)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
File.open(filename_for('minitest'), "w") { |file| file << xml.target! }
|
32
40
|
else
|
33
41
|
suites.each do |suite, tests|
|
34
|
-
|
42
|
+
xml = Builder::XmlMarkup.new(:indent => 2)
|
43
|
+
xml.instruct!
|
44
|
+
xml.test_suites do
|
45
|
+
parse_xml_for(xml, suite, tests)
|
46
|
+
end
|
47
|
+
File.open(filename_for(suite), "w") { |file| file << @xml.target! }
|
35
48
|
end
|
36
49
|
end
|
37
|
-
|
38
50
|
end
|
39
51
|
|
40
52
|
private
|
41
53
|
|
42
|
-
def
|
54
|
+
def parse_xml_for(xml, suite, tests)
|
43
55
|
suite_result = analyze_suite(tests)
|
56
|
+
file_path = Pathname.new(tests.first.method(tests.first.name).source_location.first)
|
57
|
+
base_path = Pathname.new(@base_path)
|
58
|
+
relative_path = file_path.relative_path_from(base_path)
|
44
59
|
|
45
|
-
xml
|
46
|
-
|
47
|
-
xml.testsuite(:name => suite, :skipped => suite_result[:skip_count], :failures => suite_result[:fail_count],
|
60
|
+
xml.testsuite(:name => suite, :filepath => relative_path,
|
61
|
+
:skipped => suite_result[:skip_count], :failures => suite_result[:fail_count],
|
48
62
|
:errors => suite_result[:error_count], :tests => suite_result[:test_count],
|
49
63
|
:assertions => suite_result[:assertion_count], :time => suite_result[:time]) do
|
50
64
|
tests.each do |test|
|
51
|
-
|
65
|
+
lineno = test.method(test.name).source_location.last
|
66
|
+
xml.testcase(:name => test.name, :lineno => lineno, :classname => suite, :assertions => test.assertions,
|
52
67
|
:time => test.time) do
|
53
68
|
xml << xml_message_for(test) unless test.passed?
|
54
69
|
end
|
55
70
|
end
|
56
71
|
end
|
57
|
-
File.open(filename_for(suite), "w") { |file| file << xml.target! }
|
58
72
|
end
|
59
73
|
|
60
74
|
def xml_message_for(test)
|
@@ -107,6 +121,7 @@ module Minitest
|
|
107
121
|
|
108
122
|
def analyze_suite(tests)
|
109
123
|
result = Hash.new(0)
|
124
|
+
result[:time] = 0
|
110
125
|
tests.each do |test|
|
111
126
|
result[:"#{result(test)}_count"] += 1
|
112
127
|
result[:assertion_count] += test.assertions
|