Class: RRRSpec::Client::SlaveRunner::RedisReportingFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/rrrspec/client/slave_runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRedisReportingFormatter

Returns a new instance of RedisReportingFormatter.



92
93
94
95
96
97
# File 'lib/rrrspec/client/slave_runner.rb', line 92

def initialize
  @passed = 0
  @pending = 0
  @failed = 0
  @timeout = false
end

Instance Attribute Details

#failedObject (readonly)

Returns the value of attribute failed.



90
91
92
# File 'lib/rrrspec/client/slave_runner.rb', line 90

def failed
  @failed
end

#passedObject (readonly)

Returns the value of attribute passed.



90
91
92
# File 'lib/rrrspec/client/slave_runner.rb', line 90

def passed
  @passed
end

#pendingObject (readonly)

Returns the value of attribute pending.



90
91
92
# File 'lib/rrrspec/client/slave_runner.rb', line 90

def pending
  @pending
end

Instance Method Details

#example_failed(example) ⇒ Object



107
108
109
110
111
112
# File 'lib/rrrspec/client/slave_runner.rb', line 107

def example_failed(example)
  @failed += 1
  if example.exception.is_a?(SoftTimeoutException)
    @timeout = true
  end
end

#example_passed(example) ⇒ Object



99
100
101
# File 'lib/rrrspec/client/slave_runner.rb', line 99

def example_passed(example)
  @passed += 1
end

#example_pending(example) ⇒ Object



103
104
105
# File 'lib/rrrspec/client/slave_runner.rb', line 103

def example_pending(example)
  @pending += 1
end

#statusObject



114
115
116
117
118
119
120
121
122
123
124
# File 'lib/rrrspec/client/slave_runner.rb', line 114

def status
  if @timeout
    'timeout'
  elsif @failed != 0
    'failed'
  elsif @pending != 0
    'pending'
  else
    'passed'
  end
end