Class: Codeqa::RunnerDecorator
- Inherits:
-
Object
- Object
- Codeqa::RunnerDecorator
- Defined in:
- lib/codeqa/runner_decorator.rb
Instance Method Summary collapse
- #details_to_s ⇒ Object
-
#initialize(runner, options = {}) ⇒ RunnerDecorator
constructor
A new instance of RunnerDecorator.
- #sourcefile_to_s ⇒ Object
- #success_to_s ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(runner, options = {}) ⇒ RunnerDecorator
Returns a new instance of RunnerDecorator.
3 4 5 6 7 |
# File 'lib/codeqa/runner_decorator.rb', line 3 def initialize(runner, ={}) @options = { :colors => true }.merge() @runner = runner @msg = '' end |
Instance Method Details
#details_to_s ⇒ Object
21 22 23 |
# File 'lib/codeqa/runner_decorator.rb', line 21 def details_to_s error_details end |
#sourcefile_to_s ⇒ Object
9 10 11 |
# File 'lib/codeqa/runner_decorator.rb', line 9 def sourcefile_to_s info("Codeqa on :'#{@runner.sourcefile.filename}'\n") end |
#success_to_s ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/codeqa/runner_decorator.rb', line 13 def success_to_s if @runner.success? success("Passed tests: #{@runner.results.map(&:name).join(', ')}\n") else error("Failed tests: #{@runner.failures.map(&:name).join(', ')}\n") end end |
#to_s ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/codeqa/runner_decorator.rb', line 25 def to_s @msg << sourcefile_to_s @msg << success_to_s @msg << details_to_s unless @runner.success? @msg end |