如何重用Cucumber步骤定义与最后一个参数的表?

Nek*_*Nek 7 reusability cucumber

这段代码:

Then %{I should see the following data in the "Feeds" data grid:
                                                   |   Name   |
                                                   | #{name}  |}
Run Code Online (Sandbox Code Playgroud)

还有这个:

Then "I should see the following data in the \"Feeds\" data grid:
|   Name   |
| #{name}  |"
Run Code Online (Sandbox Code Playgroud)

还有这个:

  Then "I should see the following data in the \"Feeds\" data grid:\n|   Name   |\n| #{name}  |"
Run Code Online (Sandbox Code Playgroud)

甚至这个:

Then <<EOS
I should see the following data in the "Feeds" data grid:
|   Name   |
| #{name}  |
EOS
Run Code Online (Sandbox Code Playgroud)

给我:

Your block takes 2 arguments, but the Regexp matched 1 argument.
(Cucumber::ArityMismatchError)
  tests/endtoend/step_definitions/instruments_editor_steps.rb:29:in `/^the editor shows "([^"]*)" in the feeds list$/'
  melomel-0.6.0/lib/melomel/cucumber/data_grid_steps.rb:59:in `/^I should see the following data in the "([^"]*)" data grid:$/'
  tests/endtoend/instruments_editor.feature:11:in `And the editor shows "myFeed" in the feeds list
Run Code Online (Sandbox Code Playgroud)

这个:

Then "I should see the following data in the \"Feeds\" data grid: |   Name   || #{name}  |"
Run Code Online (Sandbox Code Playgroud)

还有这个:

Then "I should see the following data in the \"Feeds\" data grid:|   Name   || #{name}  |"
Run Code Online (Sandbox Code Playgroud)

得到:

Undefined step: "I should see the following data in the "Feeds" data grid:|   Name   || myFeed  |" (Cucumber::Undefined)
  ./tests/endtoend/step_definitions/instruments_editor_steps.rb:31:in `/^the editor shows "([^"]*)" in the feeds list$/'
  tests/endtoend/instruments_editor.feature:11:in `And the editor shows "myFeed" in the feeds list'
Run Code Online (Sandbox Code Playgroud)

Nek*_*Nek 6

我自己找到了答案:

steps %Q{
Then I should see the following data in the "Feeds" data grid:
                                                |   Name   |
                                                | #{name}  |
}
Run Code Online (Sandbox Code Playgroud)