I have a step definition in which I'd like to have an optional parameter. I believe an example of two calls to this step explains better than anything else what I'm after.
I check the favorite color count
I check the favorite color count for email address 'john@anywhere.com'
In the first instance, I would like to use a default email address.
What's a good way of defining this step? I'm no regexp guru. I tried doing this but cucumber gave me an error regarding regexp argument mismatches:
Then(/^I check the favorite color count (for email address "([^"]*))*"$/) do |email = "default_email@somewhere.com"|
@larryq, you were closer to the solution than you thought...
optional.feature:
optional_steps.rb
output:
optional.feature:
optional_steps.rb
output