Class: RSpectacles::Formatter::Legacy::Redis

Inherits:
RSpec::Core::Formatters::BaseFormatter
  • Object
show all
Defined in:
lib/rspectacles/formatter/legacy/redis.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_) ⇒ Redis

Returns a new instance of Redis.



10
11
# File 'lib/rspectacles/formatter/legacy/redis.rb', line 10

def initialize(_)
end

Instance Attribute Details

#outputObject (readonly)

Returns the value of attribute output.



8
9
10
# File 'lib/rspectacles/formatter/legacy/redis.rb', line 8

def output
  @output
end

Instance Method Details

#closeObject



45
46
# File 'lib/rspectacles/formatter/legacy/redis.rb', line 45

def close
end

#example_failed(example) ⇒ Object



41
42
43
# File 'lib/rspectacles/formatter/legacy/redis.rb', line 41

def example_failed(example)
  logger.log_formatted example
end

#example_passed(example) ⇒ Object



33
34
35
# File 'lib/rspectacles/formatter/legacy/redis.rb', line 33

def example_passed(example)
  logger.log_formatted example
end

#example_pending(example) ⇒ Object



37
38
39
# File 'lib/rspectacles/formatter/legacy/redis.rb', line 37

def example_pending(example)
  logger.log_formatted example
end

#example_started(example) ⇒ Object



30
31
# File 'lib/rspectacles/formatter/legacy/redis.rb', line 30

def example_started(example)
end

#loggerObject



13
14
15
# File 'lib/rspectacles/formatter/legacy/redis.rb', line 13

def logger
  @logger ||= RSpectacles::Adapter::RedisLogger.new
end

#message(message) ⇒ Object



17
18
19
# File 'lib/rspectacles/formatter/legacy/redis.rb', line 17

def message(message)
  logger.log "message:#{message}"
end

#start(example_count) ⇒ Object



21
22
23
24
# File 'lib/rspectacles/formatter/legacy/redis.rb', line 21

def start(example_count)
  logger.log 'status:start'
  logger.delete_last_log
end

#stopObject



26
27
28
# File 'lib/rspectacles/formatter/legacy/redis.rb', line 26

def stop
  logger.log 'status:stop'
end