Class: RSpectacles::Formatter::Base
- Inherits:
-
Object
- Object
- RSpectacles::Formatter::Base
- Defined in:
- lib/rspectacles/formatter/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #config ⇒ Object
- #current_run_key ⇒ Object
- #example_failed(notification) ⇒ Object
- #example_passed(notification) ⇒ Object
- #example_pending(notification) ⇒ Object
-
#initialize(_) ⇒ Base
constructor
A new instance of Base.
- #logger ⇒ Object
- #message(notification) ⇒ Object
- #start(_) ⇒ Object
- #stop(_) ⇒ Object
Constructor Details
#initialize(_) ⇒ Base
Returns a new instance of Base.
15 16 |
# File 'lib/rspectacles/formatter/base.rb', line 15 def initialize(_) end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
13 14 15 |
# File 'lib/rspectacles/formatter/base.rb', line 13 def output @output end |
Instance Method Details
#config ⇒ Object
49 50 51 |
# File 'lib/rspectacles/formatter/base.rb', line 49 def config RSpectacles.config end |
#current_run_key ⇒ Object
45 46 47 |
# File 'lib/rspectacles/formatter/base.rb', line 45 def current_run_key ENV['CURRENT_RSPEC_RUN'] || config.last_run_primary_key end |
#example_failed(notification) ⇒ Object
41 42 43 |
# File 'lib/rspectacles/formatter/base.rb', line 41 def example_failed(notification) logger.log notification.example end |
#example_passed(notification) ⇒ Object
33 34 35 |
# File 'lib/rspectacles/formatter/base.rb', line 33 def example_passed(notification) logger.log notification.example end |
#example_pending(notification) ⇒ Object
37 38 39 |
# File 'lib/rspectacles/formatter/base.rb', line 37 def example_pending(notification) logger.log notification.example end |
#logger ⇒ Object
18 19 20 |
# File 'lib/rspectacles/formatter/base.rb', line 18 def logger @logger ||= RSpectacles::Adapter::Logger.new(test_run_key: current_run_key) end |
#message(notification) ⇒ Object
22 23 |
# File 'lib/rspectacles/formatter/base.rb', line 22 def (notification) end |
#start(_) ⇒ Object
25 26 27 |
# File 'lib/rspectacles/formatter/base.rb', line 25 def start(_) logger.start end |
#stop(_) ⇒ Object
29 30 31 |
# File 'lib/rspectacles/formatter/base.rb', line 29 def stop(_) logger.stop end |