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

Scenario names cannot start with a keyword #210

Open
pedantic-git opened this issue Oct 30, 2018 · 0 comments
Open

Scenario names cannot start with a keyword #210

pedantic-git opened this issue Oct 30, 2018 · 0 comments

Comments

@pedantic-git
Copy link
Contributor

[Please move this to gherkin-ruby if you prefer]

I discovered this by accident, having a scenario called Buttons don't appear, which begins with the keyword But. It looks like all keywords at the start of scenario names cause the parser to fail (on step generation or feature execution). For example:

Feature: Wibble

Scenario: Given a lot of money
  Given I am an example
  When I do example things
  Then I should work
$ ./bin/spinach -g features/wibble.feature
Traceback (most recent call last):
	13: from ./bin/spinach:3:in `<main>'
	12: from ./bin/spinach:3:in `load'
	11: from /usr/src/app/vendor/bundle/ruby/2.5.0/gems/spinach-0.10.1/bin/spinach:15:in `<top (required)>'
	10: from /usr/src/app/vendor/bundle/ruby/2.5.0/gems/spinach-0.10.1/lib/spinach/cli.rb:30:in `run'
	 9: from /usr/src/app/vendor/bundle/ruby/2.5.0/gems/spinach-0.10.1/lib/spinach/runner.rb:61:in `run'
	 8: from /usr/src/app/vendor/bundle/ruby/2.5.0/gems/spinach-0.10.1/lib/spinach/runner.rb:61:in `map'
	 7: from /usr/src/app/vendor/bundle/ruby/2.5.0/gems/spinach-0.10.1/lib/spinach/runner.rb:65:in `block in run'
	 6: from /usr/src/app/vendor/bundle/ruby/2.5.0/gems/spinach-0.10.1/lib/spinach/parser.rb:39:in `parse'
	 5: from /usr/src/app/vendor/bundle/ruby/2.5.0/gems/gherkin-ruby-0.3.2/lib/gherkin_ruby.rb:8:in `parse'
	 4: from gherkin.y:107:in `parse'
	 3: from /usr/src/app/vendor/bundle/ruby/2.5.0/gems/gherkin-ruby-0.3.2/lib/gherkin_ruby/parser/lexer.rb:31:in `scan_str'
	 2: from /usr/local/lib/ruby/2.5.0/racc/parser.rb:259:in `do_parse'
	 1: from /usr/local/lib/ruby/2.5.0/racc/parser.rb:259:in `_racc_do_parse_c'
/usr/local/lib/ruby/2.5.0/racc/parser.rb:528:in `on_error':  (Racc::ParseError)
parse error on value "Given" (GIVEN)

It's easily worked around by renaming the scenario but I thought I'd report it in case it's not a known issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant