2010-12-22 41 views
3

我可以清楚地看到浏览器中的文本。报价里面的报价,然后我应该看到黄瓜prolmem导轨

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 

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

或者是报价内引用的转义问题?

谢谢

回答

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