cucumber/cucumber — pull request #390 by rdvdijk (2013-03-07 08:53:36+00:00)
Title: Add snippet type to support different type of ruby snippets.

Take a look at these issues: https://github.com/cucumber/cucumber/issues/328 and https://github.com/cucumber/cucumber/issues/331.

### The change

Ruby snippets have now changed from this form:

```ruby
When /^there is a missing step$/ do
pending # express the regexp above with the code you wish you had
end
```

to:

```ruby
When(/^there is a missing step$/) do
pending # express the regexp above with the code you wish you had
end
```

This pull request gives the command line option to change Ruby snippet formats.

Using `--snippet-type regexp` is the default, and will create snippets with parentheses.
Using `--snippet-type legacy` will create snippets the old way, without parentheses.
Using `--snippet-type percent` will create snippets the with percent-style regular expressions:

```ruby
When %r{^there is a missing step$} do
pending # express the regexp above with the code you wish you had
end
```

### Disclaimer

I'm not too happy about adding a fourth argument to the `Cucumber::RbSupport::RbLanguage#snippet_text` and all other languages. I couldn't found another way to get to this option, I hope this is acceptable.