Question

I'm getting a nasty syntax error when I try to run bundle exec cucumber or rake cucumber:

~/.rvm/gems/ruby-1.9.3-p0@rails31/gems/cucumber-1.1.4/lib/cucumber/js_support/js_dsl.js:3: syntax error, unexpected '{', expecting keyword_then or ';' or '\n'

As well as several other syntax errors from the same file. When I run the features via bundle exec guard, everything works fine.

I am using:

  • Cucumber 1.1.4
  • Rails 3.2
  • Ruby 1.9.3
  • Guard 1.0.0, guard-cucumber 0.7.5
  • Spork 1.0.0rc2, guard-spork 0.5.2

This seems like some sort of compatibility problem but it's not apparent to me what the issue is. Thanks.

Was it helpful?

Solution

This turned out to be an issue with the tags syntax in my cucumber.yml file.

Before

std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip ~@javascript"

Fixed

std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip --tags ~@javascript"

I was not familiar with the --tags syntax. Reference

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top