引用内部引用然后我应该看到黄瓜prolmem rails

时间:2010-12-22 06:15:06

标签: cucumber quote

我可以在浏览器中清楚地看到文字。

characters should be "R", "P", or "B".

但是当我写一步黄瓜步骤时

Then I should see "characters should be \"R\", \"P\", or \"B\"."

它说它

Undefined step: "I should see "characters should be \"R\", \"P\", or \"B\"."" (Cucumber::Undefined)

并说将步骤定义为

Then /^I should see "([^"]*)"R\\"([^"]*)"P\\"([^"]*)"B\\"([^"]*)"$/ do |arg1, arg2, arg3, arg4|
    pending # express the regexp above with the code you wish you had
end

为什么黄瓜不承认这一步?

或者引用内部引用的问题是什么?

由于

1 个答案:

答案 0 :(得分:0)

Pystring可能有用。使用三个双引号将整行表示为字符串。

黄瓜步骤

Then I should see
"""
characters should be "R", "P", or "B".
"""

步骤定义

Then /^I should see "([^"]*)"$/ do |string|
  pending # express the regexp above with the code you wish you had
end