1
votes

I keep getting an issue with rspec when I

bundle exec rake spec
/Users/sean/.rvm/gems/ruby-1.9.2-p0@hub/gems/rspec-core-2.4.0/lib/rspec/core/option_parser.rb:18:in `parse!': invalid option: --autotest (OptionParser::InvalidOption)
        from /Users/sean/.rvm/gems/ruby-1.9.2-p0@hub/gems/rspec-core-2.4.0/lib/rspec/core/option_parser.rb:4:in `parse!'
        from /Users/sean/.rvm/gems/ruby-1.9.2-p0@hub/gems/rspec-core-2.4.0/lib/rspec/core/configuration_options.rb:104:in `options_from'
        from /Users/sean/.rvm/gems/ruby-1.9.2-p0@hub/gems/rspec-core-2.4.0/lib/rspec/core/configuration_options.rb:100:in `global_options'
        from /Users/sean/.rvm/gems/ruby-1.9.2-p0@hub/gems/rspec-core-2.4.0/lib/rspec/core/configuration_options.rb:65:in `parse_options'
        from /Users/sean/.rvm/gems/ruby-1.9.2-p0@hub/gems/rspec-core-2.4.0/lib/rspec/core/runner.rb:41:in `run'
        from /Users/sean/.rvm/gems/ruby-1.9.2-p0@hub/gems/rspec-core-2.4.0/lib/rspec/core/runner.rb:10:in `block in autorun'

I'm not sure what the problem is. I have tried uninstalling my gems and reinstalling them. I've tried different versions of rspec2. The same application's specs used to work for me. I have no idea what might have changed that introduced this error.

Any ideas?

2

2 Answers

2
votes

Actually, you don't even need that. All you need is a .rspec file in the project root directory (it can have options or be empty) to add the "rspec2" discovery, and "rails" gets discovered based on a rails-like directory structure.

2
votes

Do you have this option defined in ./.rspec?:

--autotest

If so, remove it.

EDIT

Autotest is now configured in ./autotest/discover.rb, which should contain:

Autotest.add_discovery { "rails" }
Autotest.add_discovery { "rspec2" }

Seems this is no longer necessary. See David's answer