views:

28

answers:

1

Hello everyone,

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 the regexp above with the code you wish you had
end

Any ideas, how to strip in this step?

+1  A: 

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.

Marc-André Lafortune