Quote inside quote, then I have to see the cucumber flying rails

I can see the text in the browser.

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

But when I write step cucumber step

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

He says his

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

and says to determine 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 does the cucumber not recognize this step?

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

thank

+3
source share
1 answer

Pystring may work. Use three double characters to indicate an entire string as a string.

Cucumber pitch

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
source

Source: https://habr.com/ru/post/1781594/


All Articles