Class: TurnipFormatter::Resource::Step::Step

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
FailureResult, PendingResult
Defined in:
lib/turnip_formatter/resource/step/step.rb

Instance Attribute Summary collapse

Attributes included from PendingResult

#pending_location, #pending_message

Instance Method Summary collapse

Methods included from PendingResult

#pending?, #set_pending

Methods included from FailureResult

#exceptions, #failed?, #set_exceptions

Constructor Details

#initialize(example, raw) ⇒ Step

Returns a new instance of Step.

Parameters:

  • example (RSpec::Core::Example)
  • raw (Turnip::Node::Step)


21
22
23
24
25
# File 'lib/turnip_formatter/resource/step/step.rb', line 21

def initialize(example, raw)
  @example = example
  @raw = raw
  @executed = false
end

Instance Attribute Details

#exampleObject (readonly)

Returns the value of attribute example.



15
16
17
# File 'lib/turnip_formatter/resource/step/step.rb', line 15

def example
  @example
end

Instance Method Details

#executed?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/turnip_formatter/resource/step/step.rb', line 31

def executed?
  @executed
end

#mark_as_executedObject



27
28
29
# File 'lib/turnip_formatter/resource/step/step.rb', line 27

def mark_as_executed
  @executed = true
end

#statusObject



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/turnip_formatter/resource/step/step.rb', line 35

def status
  case
  when failed?
    :failed
  when pending?
    :pending
  when executed?
    :passed
  else
    :unexecute
  end
end