Class: Minitest::CompositeReporter
- Inherits:
-
AbstractReporter
- Object
- AbstractReporter
- Minitest::CompositeReporter
- Defined in:
- lib/minitest.rb
Overview
Dispatch to multiple reporters as one.
Instance Attribute Summary collapse
-
#reporters ⇒ Object
The list of reporters to dispatch to.
Instance Method Summary collapse
-
#<<(reporter) ⇒ Object
Add another reporter to the mix.
-
#initialize(*reporters) ⇒ CompositeReporter
constructor
:nodoc:.
-
#io ⇒ Object
:nodoc:.
-
#passed? ⇒ Boolean
:nodoc:.
-
#prerecord(klass, name) ⇒ Object
:nodoc:.
-
#record(result) ⇒ Object
:nodoc:.
-
#report ⇒ Object
:nodoc:.
-
#start ⇒ Object
:nodoc:.
Methods inherited from AbstractReporter
Constructor Details
permalink #initialize(*reporters) ⇒ CompositeReporter
:nodoc:
970 971 972 973 |
# File 'lib/minitest.rb', line 970 def initialize *reporters # :nodoc: super() self.reporters = reporters end |
Instance Attribute Details
Instance Method Details
permalink #<<(reporter) ⇒ Object
Add another reporter to the mix.
982 983 984 |
# File 'lib/minitest.rb', line 982 def << reporter self.reporters << reporter end |
permalink #io ⇒ Object
:nodoc:
975 976 977 |
# File 'lib/minitest.rb', line 975 def io # :nodoc: reporters.first.io end |
permalink #passed? ⇒ Boolean
:nodoc:
986 987 988 |
# File 'lib/minitest.rb', line 986 def passed? # :nodoc: self.reporters.all?(&:passed?) end |
permalink #prerecord(klass, name) ⇒ Object
:nodoc:
994 995 996 997 998 999 |
# File 'lib/minitest.rb', line 994 def prerecord klass, name # :nodoc: self.reporters.each do |reporter| # TODO: remove conditional for minitest 6 reporter.prerecord klass, name if reporter.respond_to? :prerecord end end |
permalink #record(result) ⇒ Object
:nodoc:
1001 1002 1003 1004 1005 |
# File 'lib/minitest.rb', line 1001 def record result # :nodoc: self.reporters.each do |reporter| reporter.record result end end |
permalink #report ⇒ Object
:nodoc:
1007 1008 1009 |
# File 'lib/minitest.rb', line 1007 def report # :nodoc: self.reporters.each(&:report) end |
permalink #start ⇒ Object
:nodoc:
990 991 992 |
# File 'lib/minitest.rb', line 990 def start # :nodoc: self.reporters.each(&:start) end |