开发者

quote inside quote for then i should see cucumber prolmem rails

开发者 https://www.devze.com 2023-01-31 13:31 出处:网络
I can clearly see the text in browser. characters should be \"R\"开发者_C百科, \"P\", or \"B\". But when I write a step a cucumber step

I can clearly see the text in browser.

characters should be "R"开发者_C百科, "P", or "B".

But when I write a step a cucumber step

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

It says its

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

and says to define the step as

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

Why is cucumber not recognizing this step?

Or is it the escaping problem of the quote inside quote?

Thanks


A Pystring might work. Use three doublequotes to indicate an entire line as a string.

Cucumber step

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

Step definition

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号