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:.
Constructor Details
#initialize(*reporters) ⇒ CompositeReporter
:nodoc:
826 827 828 829 |
# File 'lib/minitest.rb', line 826 def initialize *reporters # :nodoc: super() self.reporters = reporters end |
Instance Attribute Details
#reporters ⇒ Object
The list of reporters to dispatch to.
824 825 826 |
# File 'lib/minitest.rb', line 824 def reporters @reporters end |
Instance Method Details
#<<(reporter) ⇒ Object
Add another reporter to the mix.
838 839 840 |
# File 'lib/minitest.rb', line 838 def << reporter self.reporters << reporter end |
#io ⇒ Object
:nodoc:
831 832 833 |
# File 'lib/minitest.rb', line 831 def io # :nodoc: reporters.first.io end |
#passed? ⇒ Boolean
:nodoc:
842 843 844 |
# File 'lib/minitest.rb', line 842 def passed? # :nodoc: self.reporters.all?(&:passed?) end |
#prerecord(klass, name) ⇒ Object
:nodoc:
850 851 852 853 854 855 |
# File 'lib/minitest.rb', line 850 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 |
#record(result) ⇒ Object
:nodoc:
857 858 859 860 861 |
# File 'lib/minitest.rb', line 857 def record result # :nodoc: self.reporters.each do |reporter| reporter.record result end end |
#report ⇒ Object
:nodoc:
863 864 865 |
# File 'lib/minitest.rb', line 863 def report # :nodoc: self.reporters.each(&:report) end |
#start ⇒ Object
:nodoc:
846 847 848 |
# File 'lib/minitest.rb', line 846 def start # :nodoc: self.reporters.each(&:start) end |