Module: Minitest::Reporters
- Defined in:
- lib/minitest/reporters.rb,
lib/minitest/reporters/version.rb,
lib/minitest/reporters/base_reporter.rb,
lib/minitest/reporters/spec_reporter.rb,
lib/minitest/reporters/junit_reporter.rb,
lib/minitest/reporters/default_reporter.rb,
lib/minitest/reporters/progress_reporter.rb,
lib/minitest/reporters/ruby_mate_reporter.rb
Defined Under Namespace
Classes: BaseReporter, DefaultReporter, JUnitReporter, ProgressReporter, RubyMateReporter, SpecReporter
Constant Summary
collapse
- VERSION =
'1.0.1'
Class Attribute Summary collapse
-
.reporters
Returns the value of attribute reporters.
Class Method Summary
collapse
Class Attribute Details
.reporters
Returns the value of attribute reporters.
19
20
21
|
# File 'lib/minitest/reporters.rb', line 19
def reporters
@reporters
end
|
Class Method Details
.choose_reporters(console_reporters, env)
55
56
57
58
59
60
61
62
63
|
# File 'lib/minitest/reporters.rb', line 55
def self.choose_reporters(console_reporters, env)
if env["TM_PID"]
[RubyMateReporter.new]
elsif env["RM_INFO"] || env["TEAMCITY_VERSION"]
[RubyMineReporter.new]
else
Array(console_reporters)
end
end
|
.use!(console_reporters = ProgressReporter.new, env = ENV, backtrace_filter = ExtensibleBacktraceFilter.default_filter)
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/minitest/reporters.rb', line 22
def self.use!(console_reporters = ProgressReporter.new, env = ENV, backtrace_filter = ExtensibleBacktraceFilter.default_filter)
use_runner!(console_reporters, env)
Minitest.backtrace_filter = backtrace_filter
unless defined?(@@loaded)
use_around_test_hooks!
use_old_activesupport_fix!
@@loaded = true
end
end
|
.use_around_test_hooks!
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/minitest/reporters.rb', line 37
def self.use_around_test_hooks!
Minitest::Test.class_eval do
def run_with_hooks(*args)
if defined?(Minitest::Reporters) && reporters = Minitest::Reporters.reporters
reporters.each { |r| r.before_test(self) }
result = run_without_hooks(*args)
reporters.each { |r| r.after_test(self) }
result
else
run_without_hooks(*args)
end
end
alias_method :run_without_hooks, :run
alias_method :run, :run_with_hooks
end
end
|
.use_old_activesupport_fix!
65
66
67
68
69
|
# File 'lib/minitest/reporters.rb', line 65
def self.use_old_activesupport_fix!
if defined?(ActiveSupport::VERSION) && ActiveSupport::VERSION::MAJOR < 4
require "minitest/old_activesupport_fix"
end
end
|
.use_runner!(console_reporters, env)
33
34
35
|
# File 'lib/minitest/reporters.rb', line 33
def self.use_runner!(console_reporters, env)
self.reporters = choose_reporters(console_reporters, env)
end
|