【发布时间】:2012-11-26 07:04:18
【问题描述】:
在对有问题的问题进行故障排除时,出现了两条相互矛盾的错误消息;与声明:
When /^(?:|I )uncheck "([^"]*)"$/ do |field|
check(field)
end
添加到 'features/step_definitions/movie_steps.rb' 执行 'bundle exec cucumber features/filter_movie_list.feature' 会导致:
Ambiguous match of "I uncheck "ratings_G"":
features/step_definitions/movie_steps.rb:65:in '/^(?:|I )uncheck "([^"]*)"$/
features/step_definitions/web_steps.rb:65:in '/^(?:|I )uncheck "([^"]*)"$/
但是,删除步骤不会导致使用“web_steps.rb”中的步骤定义;而是显示不同的错误消息:
When I uncheck the following ratings: G, PG-13 # features/step_definitions/movie_steps.rb:44
Undefined step: "When I uncheck "ratings_G"" (Cucumber::Undefined)
./features/step_definitions/movie_steps.rb:52:in `block (2 levels) in <top (required)>'
./features/step_definitions/movie_steps.rb:49:in `each'
./features/step_definitions/movie_steps.rb:49:in `/I (un)?check the following ratings: (.*)/'
features/filter_movie_list.feature:30:in `When I uncheck the following ratings: G, PG-13'
当两个地方有两个定义时,Cucumber 怎么可能抱怨一个步骤是多余的,但后来又抱怨删除重复的步骤时没有定义相同的步骤?是否有可能第二条错误消息真的意味着不同于所述内容?
PS:配置是通过 Cucumber 安装完成的,带有 CS169.x1 @ edX 的训练轮...
【问题讨论】:
标签: ruby-on-rails ruby cucumber