Class: Teabag::Runner
- Inherits:
-
Object
- Object
- Teabag::Runner
- Defined in:
- lib/teabag/runner.rb
Instance Attribute Summary collapse
-
#failure_count ⇒ Object
readonly
Returns the value of attribute failure_count.
-
#formatters ⇒ Object
Returns the value of attribute formatters.
Instance Method Summary collapse
-
#initialize(suite_name = :default) ⇒ Runner
constructor
A new instance of Runner.
- #process(line) ⇒ Object
- #suppress_logs? ⇒ Boolean
Constructor Details
#initialize(suite_name = :default) ⇒ Runner
Returns a new instance of Runner.
10 11 12 13 14 |
# File 'lib/teabag/runner.rb', line 10 def initialize(suite_name = :default) @suite_name = suite_name @formatters = Teabag.configuration.formatters.map{ |f| resolve_formatter(f).new(suite_name) } @failure_count = 0 end |
Instance Attribute Details
#failure_count ⇒ Object (readonly)
Returns the value of attribute failure_count.
8 9 10 |
# File 'lib/teabag/runner.rb', line 8 def failure_count @failure_count end |
#formatters ⇒ Object
Returns the value of attribute formatters.
7 8 9 |
# File 'lib/teabag/runner.rb', line 7 def formatters @formatters end |
Instance Method Details
#process(line) ⇒ Object
26 27 28 29 |
# File 'lib/teabag/runner.rb', line 26 def process(line) return if output_from(line) log line unless suppress_logs? end |
#suppress_logs? ⇒ Boolean
16 17 18 19 20 21 22 23 24 |
# File 'lib/teabag/runner.rb', line 16 def suppress_logs? return @suppress_logs unless @suppress_logs.nil? @suppress_logs = Teabag.configuration.suppress_log return true if @suppress_logs for formatter in @formatters return @suppress_logs = true if formatter.suppress_logs? end @suppress_logs = false end |