Optional quotes prevent vim-cucumber from finding a step
JESii opened this issue · comments
Jon Seidel commented
I have the following steps in my feature file:
And I swipe "left" a random number of times
And I swipe "right" a random number of times
and the following step definition:
Given(/^I swipe "?([^"]*)"? a random number of times$/) do |direction|
With this step definition, ]{Ctrl-D} yields "E388: Couldn't find definition"
However, if I remove the two question marks and just use this:
Given(/^I swipe "([^"]*)" a random number of times$/) do |direction|
Then vim-cucumber finds the step as expected.
Regardless of which version of the step definition I use, cucumber properly accesses the step.
Tim Pope commented
Feel free to submit an improvement to the Ruby-to-Vim regex translation in s:step_match
. Though my recommendation would be you standardize your step syntax rather than complicate your regex.