引用里面的引用,然后我应该看到黄瓜 prolmem 导轨

发布于 2024-10-08 10:34:54 字数 610 浏览 7 评论 0原文

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

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

为什么黄瓜不识别此步骤?

还是引用内引用的转义问题?

谢谢

I can clearly see the text in browser.

characters should be "R", "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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

李不 2024-10-15 10:34:54

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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文