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
#initialize(*reporters) ⇒ CompositeReporter
:nodoc:
898 899 900 901 |
# File 'lib/minitest.rb', line 898 def initialize *reporters # :nodoc: super() self.reporters = reporters end |
Instance Attribute Details
#reporters ⇒ Object
The list of reporters to dispatch to.
896 897 898 |
# File 'lib/minitest.rb', line 896 def reporters @reporters end |
Instance Method Details
#<<(reporter) ⇒ Object
Add another reporter to the mix.
910 911 912 |
# File 'lib/minitest.rb', line 910 def << reporter self.reporters << reporter end |
#io ⇒ Object
:nodoc:
903 904 905 |
# File 'lib/minitest.rb', line 903 def io # :nodoc: reporters.first.io end |
#passed? ⇒ Boolean
:nodoc:
914 915 916 |
# File 'lib/minitest.rb', line 914 def passed? # :nodoc: self.reporters.all?(&:passed?) end |
#prerecord(klass, name) ⇒ Object
:nodoc:
922 923 924 925 926 927 |
# File 'lib/minitest.rb', line 922 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:
929 930 931 932 933 |
# File 'lib/minitest.rb', line 929 def record result # :nodoc: self.reporters.each do |reporter| reporter.record result end end |
#report ⇒ Object
:nodoc:
935 936 937 |
# File 'lib/minitest.rb', line 935 def report # :nodoc: self.reporters.each(&:report) end |
#start ⇒ Object
:nodoc:
918 919 920 |
# File 'lib/minitest.rb', line 918 def start # :nodoc: self.reporters.each(&:start) end |