Class: Cucumber::Runtime::SupportCode::StepInvoker
- Defined in:
- lib/cucumber/runtime/support_code.rb
Instance Method Summary collapse
-
#initialize(support_code) ⇒ StepInvoker
constructor
A new instance of StepInvoker.
- #multiline_arg(step, location) ⇒ Object
- #step(step) ⇒ Object
- #steps(steps) ⇒ Object
Constructor Details
#initialize(support_code) ⇒ StepInvoker
Returns a new instance of StepInvoker.
19 20 21 |
# File 'lib/cucumber/runtime/support_code.rb', line 19 def initialize(support_code) @support_code = support_code end |
Instance Method Details
#multiline_arg(step, location) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/cucumber/runtime/support_code.rb', line 32 def multiline_arg(step, location) if argument = step[:argument] if argument[:type] == :DocString MultilineArgument.doc_string(argument[:content], argument[:content_type], location) else MultilineArgument::DataTable.from(argument[:rows].map { |row| row[:cells].map { |cell| cell[:value] } }) end else MultilineArgument.from(nil) end end |
#step(step) ⇒ Object
27 28 29 30 |
# File 'lib/cucumber/runtime/support_code.rb', line 27 def step(step) location = Core::Ast::Location.of_caller @support_code.invoke_dynamic_step(step[:text], multiline_arg(step, location)) end |
#steps(steps) ⇒ Object
23 24 25 |
# File 'lib/cucumber/runtime/support_code.rb', line 23 def steps(steps) steps.each { |step| step(step) } end |