As of latest rspec version, autotest automatically uses command-line 'bundle exec' whenever it detects Gemfile in current directory. Is it possible to make an option to disable such a behaviour?
I think it is safe to assume bundler exec to be a reasonable default for testing but there could be a case when I want to disable that behaviour.
We're making it an opt-in for the rake task, and will do the same for autotest as well.
vote += 1
I had a Gemfile laying around because I was trying Bundler, but had removed all reference to it in my application. It was confusing and difficult to debug when I got unexpected "gem not found: xyz" errors, with no mention of bundler and its "cripple_rubygems" code in the backtrace. I'd rather the Rakefile / autotest code be explicit about whether or not it's using bundler, especially because gem-related errors have no indication that bundler's involved.
You can add this code to .autotest file for now:
class Autotest::Rspec2 < Autotest
just added a -b / --bundle-exec to autotest, so you could use if options[:bundle_exec] in the autotest-related part
I've put together a solution for this. In addition, it addresses sending command line options through Autotest to RSpec.
It requires that Autotest (ZenTest) accept an option '--extra' which receives an array argument. arailsdemo/zentest@d77e3a4
Then in rspec2.rb, we can parse out the options.
(edit - Sorry, had to fix something here .)
$ autotest -x t,my_tag -x format,documentation
This would send RSpec '-t my_tag --format documentation'.
'rspec' becomes the default command. If you want to used 'bundle exec ...', you can do
$ autotest -x bundle
If this is an acceptable solution, I can write some tests.
FYI: works in autotest-standalone 4.5.4
@arailsdemo/@grosser - I'd prefer a solution that does not require any changes to Autotest. Something with the .rspec file or some such.
Add -- --skip-bundler option for autotest
FYI - this option ended up not working. I still don't know why - I know it worked at one point, but then when I released it, it did not :(
So I removed this entirely in the 2.5.1 release. Now the default is to not include 'bundle exec', and to include it, you can use the autotest/bundler plugin. See http://blog.davidchelimsky.net/2011/02/06/rspec-250-is-released/ and http://blog.davidchelimsky.net/2011/02/06/rspec-core-251-is-released/ for more info.
- Closes #191.