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

Add support for Cucumber Expressions #1002

Closed
aslakhellesoy opened this issue Aug 8, 2016 · 2 comments
Closed

Add support for Cucumber Expressions #1002

aslakhellesoy opened this issue Aug 8, 2016 · 2 comments

Comments

@aslakhellesoy
Copy link
Contributor

aslakhellesoy commented Aug 8, 2016

Summary

Cucumber Expressions is a new alternative to
Regular Expressions, which is easier to read and write, and less daunting.

Expected Behavior

Step Defintions defined with a String (and not a Regexp) should be interpreted as a Cucumber Expression:

Given("I have {int} cuke(s) in my belly/stomach") do |cuke_count|
  # It's already converted to a number
  expect(cuke_count).to be_a(Fixnum)
end

Likewise, if a Regular Expression is used (old school):

Given(/I have (\d+) cuke(?:s)? in my (?:belly|stomach)/ do |cuke_count|
  # It's already converted to a number
  expect(cuke_count).to be_a(Fixnum)
end

This is possible because the cucumber-expression library's Regexp support takes advantage of type conversions too.

Snippets for undefined steps should use Cucumber Expressions, and not Regular Expressions. We want users to start migrating, and if we can avoid it we'll not generate snippets with regular expressions. (Well, we might if enough people want it). The cucumber-expression library can already generate expressions from text.

Finally, the current Transform logic should be deprecated and the logic built into the cucumber-expression library should be used instead.

Context & Motivation

Having to use Regular Expressions is one of the most common complaints against Cucumber. Other clones of Cucumber who support something similar to Cucumber Expressions seem to have happier users!

@aslakhellesoy
Copy link
Contributor Author

Fixed in 3.0.0

@lock
Copy link

lock bot commented Oct 24, 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 Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant