Class: RSpec::Steps::StepResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec-steps/step-result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#exceptionObject

Returns the value of attribute exception

Returns:

  • (Object)

    the current value of exception



2
3
4
# File 'lib/rspec-steps/step-result.rb', line 2

def exception
  @exception
end

#failed_stepObject

Returns the value of attribute failed_step

Returns:

  • (Object)

    the current value of failed_step



2
3
4
# File 'lib/rspec-steps/step-result.rb', line 2

def failed_step
  @failed_step
end

#resultObject

Returns the value of attribute result

Returns:

  • (Object)

    the current value of result



2
3
4
# File 'lib/rspec-steps/step-result.rb', line 2

def result
  @result
end

#stepObject

Returns the value of attribute step

Returns:

  • (Object)

    the current value of step



2
3
4
# File 'lib/rspec-steps/step-result.rb', line 2

def step
  @step
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/rspec-steps/step-result.rb', line 3

def failed?
  return (!exception.nil?)
end

#has_executed_successfully?Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
14
15
16
17
# File 'lib/rspec-steps/step-result.rb', line 7

def has_executed_successfully?
  if failed_step.nil?
    if exception.nil?
      true
    else
      raise exception
    end
  else
    raise failed_step.exception
  end
end

#is_after_failed_step?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/rspec-steps/step-result.rb', line 19

def is_after_failed_step?
  !!failed_step
end