Class: RSpec::Retryable::Payload

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/retryable/payload.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(example, state) ⇒ Payload

Default payload with:

  • example: RSpec example

  • state: Current state of the example, can be alterted by handlers

  • notify: default to ‘true`, if set to `false`, reporter will not be notified

  • result: this is the final result returned to RSpec runner

  • retry: default to ‘false`, if set to `true`, the example will be retried



15
16
17
18
19
20
21
# File 'lib/rspec/retryable/payload.rb', line 15

def initialize(example, state)
  @example = example
  @state = state
  @notify = true
  @result = state == :failed ? false : true
  @retry = false
end

Instance Attribute Details

#exampleObject (readonly)

Returns the value of attribute example.



6
7
8
# File 'lib/rspec/retryable/payload.rb', line 6

def example
  @example
end

#notifyObject

Returns the value of attribute notify.



7
8
9
# File 'lib/rspec/retryable/payload.rb', line 7

def notify
  @notify
end

#resultObject

Returns the value of attribute result.



7
8
9
# File 'lib/rspec/retryable/payload.rb', line 7

def result
  @result
end

#retryObject

Returns the value of attribute retry.



7
8
9
# File 'lib/rspec/retryable/payload.rb', line 7

def retry
  @retry
end

#stateObject

Returns the value of attribute state.



7
8
9
# File 'lib/rspec/retryable/payload.rb', line 7

def state
  @state
end