Skip to content

Instantly share code, notes, and snippets.

@chris
Created April 29, 2010 15:56
Show Gist options
  • Select an option

  • Save chris/383815 to your computer and use it in GitHub Desktop.

Select an option

Save chris/383815 to your computer and use it in GitHub Desktop.
Cucumber 0.7.0 prerelease problem
# Cucumber 0.7.0 prerelease issue, contact chris at cobaltedge dot com
# The following error was due to having a feature file that was entirely commented out, with except to the tag,
# so the feature file looked like:
# @hotels
# # Feature:
# # ...
# This problem was fixed simply by also commenting out the tag :)
Using the default profile...
Parse error on line 2. Found comment when expecting one of: examples, feature, scenario, scenario_outline, tag. (Current state: tag). (Gherkin::Parser::ParseError)
/Library/Ruby/Gems/1.8/gems/gherkin-1.0.22/lib/gherkin/parser/parser.rb:37:in `event'
/Library/Ruby/Gems/1.8/gems/gherkin-1.0.22/lib/gherkin/parser/parser.rb:80:in `event'
/Library/Ruby/Gems/1.8/gems/gherkin-1.0.22/lib/gherkin/parser/parser.rb:35:in `event'
/Library/Ruby/Gems/1.8/gems/gherkin-1.0.22/lib/gherkin/parser/parser.rb:25:in `method_missing'
/Library/Ruby/Gems/1.8/gems/gherkin-1.0.22/lib/gherkin/i18n_lexer.rb:21:in `scan'
/Library/Ruby/Gems/1.8/gems/gherkin-1.0.22/lib/gherkin/i18n_lexer.rb:21:in `scan'
/Library/Ruby/Gems/1.8/gems/cucumber-0.7.0.beta.7/bin/../lib/cucumber/feature_file.rb:35:in `parse'
/Library/Ruby/Gems/1.8/gems/cucumber-0.7.0.beta.7/bin/../lib/cucumber/step_mother.rb:62:in `load_plain_text_features'
/Library/Ruby/Gems/1.8/gems/cucumber-0.7.0.beta.7/bin/../lib/cucumber/step_mother.rb:60:in `each'
/Library/Ruby/Gems/1.8/gems/cucumber-0.7.0.beta.7/bin/../lib/cucumber/step_mother.rb:60:in `load_plain_text_features'
/Library/Ruby/Gems/1.8/gems/cucumber-0.7.0.beta.7/bin/../lib/cucumber/cli/main.rb:55:in `execute!'
/Library/Ruby/Gems/1.8/gems/cucumber-0.7.0.beta.7/bin/../lib/cucumber/cli/main.rb:25:in `execute'
/Library/Ruby/Gems/1.8/gems/cucumber-0.7.0.beta.7/bin/cucumber:8
/usr/bin/cucumber:19:in `load'
/usr/bin/cucumber:19
@chris
Copy link
Author

chris commented Apr 30, 2010

Yes, just had to comment out the tag. The one thing I'd request is that the above error at least spit out the feature file that it found the problem in. It wasn't obvious, and if someone has a ton of feature files, it may be pretty tedious/time consuming to try to narrow it down.

@aslakhellesoy
Copy link

0.7.0.beta.8 (1 hour old) now reports what file a parse error occurred in.

@grumpit
Copy link

grumpit commented May 10, 2010

Was this issue resolved? I'm still getting the same error using cucumber (0.7.2) and gherkin (1.0.26)...

@aslakhellesoy
Copy link

Isn't the error message telling you the file where the parse error occurred??.

@grumpit
Copy link

grumpit commented May 10, 2010

Yeah, it is now, thank you. I know it's good form to include a Feature definition, but should that be required?

@aslakhellesoy
Copy link

Yes. Please consult the upgrading instructions for 0.7.0 in the wiki or History.txt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment