2010-12-22 42 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