Module: Dogfood::Steps::Builtins
- Defined in:
- lib/dogfood/steps/builtins.rb
Overview
Auto-included into every compiled YAML scenario. These five methods cover universal operations so YAML authors don't need custom Ruby for state transitions, manual annotations, waits, notes, or bindings.
Instance Method Summary collapse
- #manual_step(actor:, event:, action:, notes: nil) ⇒ Object
- #note(text:) ⇒ Object
- #set_binding(key:, value:) ⇒ Object
- #update_state(status:, substatus:) ⇒ Object
- #wait_for(event:, reason: nil) ⇒ Object
Instance Method Details
#manual_step(actor:, event:, action:, notes: nil) ⇒ Object
14 15 16 |
# File 'lib/dogfood/steps/builtins.rb', line 14 def manual_step(actor:, event:, action:, notes: nil) step(actor: actor, event: event, action: action, notes: notes) end |
#note(text:) ⇒ Object
22 23 24 |
# File 'lib/dogfood/steps/builtins.rb', line 22 def note(text:) step(actor: "Note", event: "Annotation", action: text) end |
#set_binding(key:, value:) ⇒ Object
26 27 28 29 |
# File 'lib/dogfood/steps/builtins.rb', line 26 def set_binding(key:, value:) @bindings ||= {} @bindings[key.to_sym] = value end |
#update_state(status:, substatus:) ⇒ Object
9 10 11 12 |
# File 'lib/dogfood/steps/builtins.rb', line 9 def update_state(status:, substatus:) @state[:status] = status.to_sym @state[:substatus] = substatus end |
#wait_for(event:, reason: nil) ⇒ Object
18 19 20 |
# File 'lib/dogfood/steps/builtins.rb', line 18 def wait_for(event:, reason: nil) step(actor: "System", event: event, action: reason ? "Waiting: #{reason}" : "Waiting") end |