Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Wrong snippet for argument followed by non-word character #449

Closed
everzet opened this Issue Feb 11, 2014 · 4 comments

Comments

Projects
None yet
2 participants
Owner

everzet commented Feb 11, 2014

Use case

This was uncovered trying to write a snippet that mixes table nodes and arguments, leading to a colon at the end of the line.

  Given the following files in "/tmp":
    |filename |
    |foo.txt  |

Failure case 1 - Arguments suffixed by colon are not replaced

  Given argument "foo":

Expected:

    /**
     * @Given argument :arg1:
     */
    public function argument($arg1)
    {
        throw new PendingException();
    }

Actual:

    /**
     * @Given argument "foo":
     */
    public function argumentFoo()
    {
        throw new PendingException();
    }

The step definition does still match the gherkin step, and the author can amend the pattern manually.

Failure case 2 - Arguments with slash suffixed by colon do not match at all

  Given argument "foo/bar":

Expected:

    /**
     * @Given argument :arg1:
     */
    public function argument($arg1)
    {
        throw new PendingException();
    }

Actual:

    /**
     * @Given argument "foo/bar":
     */
    public function argumentFooBar()
    {
        throw new PendingException();
    }

In this case the step definition will not match the gherkin step, e.g. running a second time will re-trigger snippet generation with a new 'argumentFooBar2' being generated.

@everzet everzet added this to the 2.5.1 milestone Feb 11, 2014

Owner

stof commented Feb 18, 2014

is it still an issue after #450 ?

@everzet everzet added the bug label Apr 27, 2014

Owner

stof commented Apr 29, 2014

@everzet ping

Owner

everzet commented Apr 30, 2014

It is for 2.5

Owner

stof commented Apr 30, 2014

when, using the turnip syntax to report a 2.5 issue is weird, givent hat it is not supported.

@everzet everzet closed this Jun 6, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment