Skip to content

Instantly share code, notes, and snippets.

@mpereira
Created October 31, 2010 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpereira/657079 to your computer and use it in GitHub Desktop.
Save mpereira/657079 to your computer and use it in GitHub Desktop.

If you want to do something like

Then the output should contain "\"bob saget\",1234123412"

This is the step definition you would probably write

Then /^the output should contain "(.*)$" do |text|
  Output.string.should be_include(text)
end

Which would mess up cucumber’s step definition regexp. Another way to do it is using slashes

Then /^the output should contain \/(.*)\/$/ do |text|
  Output.string.should be_include(text)
end

And this will work

Then the output should contain /"bob saget",1234123412/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment