Class: Spec::Runner::Formatter::TackFormatter
- Inherits:
-
BaseFormatter
- Object
- BaseFormatter
- Spec::Runner::Formatter::TackFormatter
- Defined in:
- lib/tack/adapters/rspec_adapter.rb
Overview
Stolen from Hydra for now
Instance Attribute Summary collapse
-
#results ⇒ Object
Returns the value of attribute results.
Instance Method Summary collapse
- #example_failed(example, counter, error = nil) ⇒ Object
- #example_passed(example) ⇒ Object
-
#example_pending(example) ⇒ Object
Stifle the output of pending examples.
-
#initialize(options) ⇒ TackFormatter
constructor
A new instance of TackFormatter.
Constructor Details
#initialize(options) ⇒ TackFormatter
Returns a new instance of TackFormatter.
25 26 27 28 29 30 31 |
# File 'lib/tack/adapters/rspec_adapter.rb', line 25 def initialize() io = StringIO.new # suppress output super(, io) @results = { :passed => [], :failed => [], :pending => []} end |
Instance Attribute Details
#results ⇒ Object
Returns the value of attribute results.
23 24 25 |
# File 'lib/tack/adapters/rspec_adapter.rb', line 23 def results @results end |
Instance Method Details
#example_failed(example, counter, error = nil) ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/tack/adapters/rspec_adapter.rb', line 46 def example_failed(example, counter, error=nil) @results[:failed] << { :description => example.description, :failure => build_failure(example, error) } end |
#example_passed(example) ⇒ Object
40 41 42 43 44 |
# File 'lib/tack/adapters/rspec_adapter.rb', line 40 def example_passed(example) @results[:passed] << { :description => example.description, } end |
#example_pending(example) ⇒ Object
Stifle the output of pending examples
34 35 36 37 38 |
# File 'lib/tack/adapters/rspec_adapter.rb', line 34 def example_pending(example) @results[:pending] << { :description => example.description, } end |