【发布时间】:2016-10-15 21:16:05
【问题描述】:
我有以下步骤定义(只是为了说明我的问题):
When(/^the calculator is run$/) do
step %{When xxx the calculator is run xxx}
end
When(/^xxx the calculator is run xxx$/) do
@output = `ruby calc.rb #{@input}`
raise('Command failed!') unless $?.success?
end
在我的功能文件中,当我调用时:
When the calculator is run
我收到错误消息:
Undefined dynamic step: "When xxx the calculator is run xxx" (Cucumber::UndefinedDynamicStep)
./features/step_definitions/calculator_steps_when.rb:2:in `/^the calculator is run$/'
features/adding.feature:11:in `When the calculator is run'
features/adding.feature:6:in `When the calculator is run'
根据文档,这应该可以。最初我有不同文件中的步骤,并认为也许我必须提供一些包含指令,但现在即使步骤在同一个文件中也会发生。我错过了什么?
谢谢
【问题讨论】:
标签: ruby cucumber automated-tests