ruby - Cucumber transform method doesn't trigger -


i try use transform method convert string symbol in step definition. doesn't trigger.

here step:

given(/^i log in "(.*?)" project$/) |project|   #here expect project symbol end 

transform method

transform /^i log in "(.*?)"$/ |project|   project = :my_symbol end 

i put transform right before step definition, still string instead of symbol.

what i'm doing wrong?

in documentation transforms, example regular expressions written without start- , end-of-string anchors. putting end-of-string $ anchor in transform expression prevents matching step.

try getting rid of anchors in transform, i.e.:

transform /i log in "(.*?)"/ |project|   project = :my_symbol end 

also ensure you're parenthesising same content:

given(/^(i log in ".*?") project$/) |project|   #here expect project symbol end 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -