File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 26
26
begin
27
27
gem 'minitest'
28
28
require 'minitest/autorun'
29
+ # NOTE: deal with maven plugin 1.0.10 setting output (gone on minitest 5) :
30
+ if Minitest . const_defined? ( :Unit ) && ! defined? ( Minitest ::Unit . output )
31
+ Minitest ::Unit . module_eval do
32
+ @@report_path = nil
33
+ def self . report_path ; @@report_path end
34
+ def self . output = ( report_path ) # called by the runit-maven-plugin
35
+ Minitest . extensions << 'output' # add a plugin (MiniT calls #plugin_output_init)
36
+ @@report_path = report_path
37
+ end
38
+ end
39
+ Minitest . module_eval do
40
+ def self . plugin_output_init ( options )
41
+ summary = self . reporter . reporters . find { |rr | rr . is_a? ( Minitest ::SummaryReporter ) }
42
+ if summary && Minitest ::Unit . report_path
43
+ summary = summary . dup
44
+ summary . io = Minitest ::Unit . report_path
45
+ self . reporter . reporters << summary
46
+ end
47
+ end
48
+ end
49
+ end
29
50
rescue LoadError
30
51
end
31
52
You can’t perform that action at this time.
0 commit comments