Class: RSpectacles::Formatter::Redis
- Inherits:
-
Object
- Object
- RSpectacles::Formatter::Redis
- Defined in:
- lib/rspectacles/formatter/redis.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(_) ⇒ Redis
constructor
A new instance of Redis.
- #logger ⇒ Object
- #message(notification) ⇒ Object
- #start(_) ⇒ Object
- #stop(_) ⇒ Object
Constructor Details
#initialize(_) ⇒ Redis
Returns a new instance of Redis.
15 16 |
# File 'lib/rspectacles/formatter/redis.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/redis.rb', line 13 def output @output end |
Instance Method Details
#config ⇒ Object
50 51 52 |
# File 'lib/rspectacles/formatter/redis.rb', line 50 def config RSpectacles.config end |
#current_run_key ⇒ Object
46 47 48 |
# File 'lib/rspectacles/formatter/redis.rb', line 46 def current_run_key ENV['CURRENT_RSPEC_RUN'] || config.last_run_primary_key end |
#example_failed(notification) ⇒ Object
42 43 44 |
# File 'lib/rspectacles/formatter/redis.rb', line 42 def example_failed(notification) logger.log_formatted notification.example end |
#example_passed(notification) ⇒ Object
34 35 36 |
# File 'lib/rspectacles/formatter/redis.rb', line 34 def example_passed(notification) logger.log_formatted notification.example end |
#example_pending(notification) ⇒ Object
38 39 40 |
# File 'lib/rspectacles/formatter/redis.rb', line 38 def example_pending(notification) logger.log_formatted notification.example end |
#logger ⇒ Object
18 19 20 |
# File 'lib/rspectacles/formatter/redis.rb', line 18 def logger @logger ||= RSpectacles::Adapter::RedisLogger.new(test_run_key: current_run_key) end |
#message(notification) ⇒ Object
22 23 24 |
# File 'lib/rspectacles/formatter/redis.rb', line 22 def (notification) logger. notification. end |
#start(_) ⇒ Object
26 27 28 |
# File 'lib/rspectacles/formatter/redis.rb', line 26 def start(_) logger.start end |
#stop(_) ⇒ Object
30 31 32 |
# File 'lib/rspectacles/formatter/redis.rb', line 30 def stop(_) logger.stop end |