开发者

How to strip a quote in a Cucumber Then-Step?

i want to strip a quote in the following cucumber expression, but i get unknown step error

Then I should see "[\"20257\"]\n"

Cucumber suggested me this :(

Then /^I should see "([^"]*)"(\d+)\\"([^"]*)"$/ do |arg1, arg2, arg3|
  pending # express t开发者_C百科he regexp above with the code you wish you had
end

Any ideas, how to strip in this step?


How about writing:

Then I should see "["20257"]\n"

With the step being:

Then /^I should see "(.*)"$/ do |txt|
  txt.gsub!('\n', "\n")
  # ...
end

Or you could use the multiline argument """ and not even have to worry about the \n substitution.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜