-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
The 'steps' method does not allow using another language #149
Comments
The issue here is a combination of things between Gherkin and Cucumber... Gherkin doesn't have a convenient way to parse steps like this with any language other than English, unfortunately, and doesn't allow specification of language via a pragma like features does. If that were to be changed (simply allowing comments within #steps( ... ) text)
but this seems a bit silly since we already (obviously) knows what language we're using for the steps file at this point. It seems reasonable to me that we would want to infer the current language for parsing steps from the language being used for the containing step itself. That could cause some minor breakage for existing non-english writing cukers. |
Interesting. We need to fix this before we release #68 |
I misspoke...we know which language the feature was written in when these steps are called, not what language the step name is. Inferring which language to parse within #steps would couple the step definitions to features in a way that they aren't currently. Is it terribly English-centric of me to want to require the language pragma after all? |
On 29 Sep 2011, at 01:07, Gregory Hnatiuk wrote:
I think it would be friendlier to the user if we can infer the default language of the Gherkin being passed into #steps from the language of the feature file where the step was matched. It seems like passing the spoken language of the reader down to the step definition wouldn't necessarily have to add much coupling, would it? |
Well, it would prevent you from being able to use nested steps written in another language (e.g. copied in from another project/ a step definition library gem, etc..) . Maybe not a huge deal. |
@ghnatiuk I see what you mean. So I think we should default to the language that the matched step was written in, but allow you to override it, either in the way you suggested or by passing a language ID as another argument to the #steps method itself. |
How to solve this problem? I wanna use chinese in the nested steps. |
@scriptfans I would suggest you work around this by extracting methods from the steps you want to nest, then calling those methods directly instead of calling |
i think i have this issue, this is still open? |
I also think I got into this issue; could you please confirm if this is still open? |
Yes, it has not been resolved. |
I think that change in Gherkin, once released, will allow us to do this now. |
Too bad my active projects are all built around English features and I can't take advantage of this :D |
Fixed by #433. |
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. |
Original Lighthouse Ticket 668
I'm not sure if this issue is related to Cucumber or Gherkin, please let me know, the original bug was related to the former.
My Gemfile.lock contains
cucumber (1.1.0)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
gherkin (~> 2.5.0)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
I want to reuse the following step that runs ok with language set as 'es' on the header.
In my steps file I have
But I get
Lexing error on line 1: ' Dado que ...
The problem is solved if I write:
Please note that to solve the issue I have to use the english keywords while passing the step to the steps method.
The text was updated successfully, but these errors were encountered: