jnicklas/turnip — pull request #55 by rchampourlier (2012-05-12 08:10:02+00:00)
Title: Corrects issue with using the same custom placeholder multiple times

There is an issue when using a custom placeholder several times: it only gets applied the first time.

I've added 2 examples showing the issue in `step_definition_spec.rb` and patched `step_definition.rb` to correct the issue.

It is due to the way `String#match` build the result's `names` when the same name is used several times:

irb(main):006:0> "3 monsters and 2 knights".match(%r{(?-mix:^(?(?-mix:\d+))\ monsters\ and\ (?(?-mix:\d+))\ knights$)}).names
=> ["count"]

Maybe this depends on the Ruby version? I'm using `1.9.2-p290`.