I have the following conversion:
Transform /^"([^"]+)" Phase$/ do |name|
which works with the step definition as follows:
Then /("(?:[^"]+)" Phase) should do something/ do |phase|
I also have the following definition of a step that uses the same "([^"]+)" Phase pattern "([^"]+)" Phase :
Given /("([^"]+)" Phase) follows ("([^"]+)" Phase)/ do |pre, post|
Here I do not want the step definition not to be performed if the indicated phases do not exist. I would like to create phases.
I would like to create a Transform that will create a phase for me to have DRY define the definitions of the steps a bit, but I cannot do this because I already have the Transform mentioned above that has exactly the same regular expression.
Basically, I would like to create a phase if this is a Given step, and fail if it is not.
Any ideas?
Misha moroshko
source share