Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

step transformations #986

Closed
akostadinov opened this issue Jun 6, 2016 · 5 comments
Closed

step transformations #986

akostadinov opened this issue Jun 6, 2016 · 5 comments
Labels
⌛ stale Will soon be closed by stalebot unless there is activity

Comments

@akostadinov
Copy link
Contributor

Hello, right now I see that cucumber does:

  1. step regular expression matching
  2. step transformation

I am trying to understand why that has been chosen. To me it makes more sense to do it the other way around. i.e. first transform and then match the steps.

In our test suite we decided to make <%= ... %> expressions expand to some ruby expression inside. Issue is that if step for example matches \w+ then using such expression in place doesn't work. It is not such a big deal as quotes can be used for parameters. Just a little harder to write the quotes.

But I thought to propose making transformation happen before matching unless there are good reasons to keep current approach.

Thank you.

@mattwynne
Copy link
Member

Can you show us a concrete example please @akostadinov? I'm struggling to visualise exactly what you mean.

@akostadinov
Copy link
Contributor Author

e.g. a step like /^I delete the(?: (\W+?))? project$/

And then this call will not be matched:

Given I delete the <%= project(-2).name %> project

Step needs to be modified to this for such use case to work:
/^I delete the(?: "(\W+?)")? project$/

But now I read
https://github.com/cucumber/cucumber/wiki/Step-Argument-Transforms

It looks like the transform step is matching individual matches instead of whole step string. I guess that this feature just can't work this way. Maybe another transform hook is needed if whole step string is to be transformed.

@stale
Copy link

stale bot commented Nov 8, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.

@stale stale bot added the ⌛ stale Will soon be closed by stalebot unless there is activity label Nov 8, 2017
@stale
Copy link

stale bot commented Nov 15, 2017

This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective.

@stale stale bot closed this as completed Nov 15, 2017
@lock
Copy link

lock bot commented Nov 15, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
⌛ stale Will soon be closed by stalebot unless there is activity
Projects
None yet
Development

No branches or pull requests

2 participants