-
-
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
Deprecate and then remove keyword methods from World #68
Comments
#149 will need to be addressed first. |
Closing this since History on master says this is done. |
Well they're been deprecated, but not removed. Shouldn't we leave this open until we do a 0.x release and remove them altogether? |
I'm wondering how to use new method #step??? When /^I fill in "([^\"]*)" translation with "([^\"]*)"$/ do |field, value|
fill_in(I18n.t(field), :with => value)
end how i should rewrite it now? can't find any documentation of new way... |
Something like this should work: step %{I fill in "#{field}" translation with "#{value}"} Does that help? |
yes, |
I do not understand your request. Could you please explain what you're asking for again? |
"WARNING: i18n methods within step definitions are deprecated" is the worst error message ever, it just took me half an hour of poking around to figure out what the hell it's trying to say and track this down. How about some plain English? "Using 'Given/When/Then' in step definitions is deprecated, use 'step' to call other steps instead." For extra credit, replace Given/When/Then with the appropriate localizations in the current environment. (Not that this really matters, since the error is hardcoded English anyway...) |
@jpakotal have some self respect dude. Instead of just whining you should send a pull request. |
I'm "whining" here so Google can match the error message to this issue and other people can figure out WTF is going on when they see that, but no, I'm not going to fork cucumber and send you a pull request to update a bloody static text string. Cut, paste, commit, be happy. |
@jpakotal. You don't have to be abrasive to make google match the error message to this issue. This software is written by volunteers in their own spare time, with the best of intentions. It's therefore very discouraging every time someone comes around and points out something that may be correct, but in a patronising and ungrateful tone. Nobody cares how long it took you to figure out what the error message says. We appreciate contributions, but please be respectful. Otherwise you'll just be ignored. |
@mattwynne - can you fix this one? You have the best insight into what was changed, why and how it should be worded. |
Sure, when I have time :) |
@aslakhellesoy: See, if you had followed your own advice and asked me nicely, I would've happily sent you the pull request. But telling an already pissed-off user who is taking the time to notify you about a problem in your software to "have some self respect" and stop "whining" is not the way to get that user to volunteer some of their spare time to help you! Anyway, now that I've calmed down, I apologize for my original abrasiveness... and here's the pull request. Here's hoping it makes a great piece of software a little bit greater. |
Thanks. Closing this ticket. |
@mattwynne , I found that cucumber wants you to drop the When, Given, Then when you use the step method. In other words, instead of
It wants you to use
Here's the quick regex I used to convert my old steps to the new DSL:
|
You're quite right - sorry for the misleading comment above. I'll edit to remove confusion for future readers. |
Related to #171 |
Not sure I fully understand this issue. I'm getting this but I'm not using a internationalization (at least not explicitly). Is the solution to replace Given/When/Then/And universally with step? I tried this but it cause all my test to break. Thanks |
The issue is that you are using Given/When/Then/And within a step to reference another step. This is no longer allowed, you have to say "step Blah blah" instead of "Given blah blah". I've also updated the Wiki page accordingly: https://github.com/cucumber/cucumber/wiki/Calling-Steps-from-Step-Definitions |
Great that's what I thought but I wasn't sure. Thanks again. |
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. |
Just try this:
The World is polluted with hundreds of methods generated from all the different languages' step keywords. We should deprecate these, and direct people to simply use #steps instead.
The text was updated successfully, but these errors were encountered: