Noncapturing groups in Cucumber:
In this first example we have to put the params "something" in order prevent an error even tho we really don't care what "something"
When /I (visit|go to) the homepage/ do | something |
# TODO: code goes here
end
One way to avoid adding an extra param we dont use is to use a noncapturing group
represented by adding ?: before the options
When /I (?:visit|go to) the homepage/ do
# TODO: code goes here
end
Written by Oscar Rieken
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Cucumber
Authors
Related Tags
#cucumber
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#