Multi-line step arguments in Cucumber

Updated . Posted . Visible to the public.

The following example is from the Cucumber wiki Show archive.org snapshot :

Given a blog post named "Random" with Markdown body
  """
  Some Title, Eh?
  ==============
  Here is the first paragraph of my blog post. Lorem ipsum dolor sit amet,
  consectetur adipiscing elit.
  """

That multi-line string will be given as the last block argument in your step definitions:

Given /^a blog post named "([^\"]*)" with Markdown body$/ do |title, markdown|
  Post.create!(:title => title, :body => markdown)
end
Henning Koch
Last edit
Daniel Straßner
Keywords
multiline, heredoc, heredocs
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2010-09-01 08:20)