rspec-autotest provides integration between autotest and RSpec; Autotest is not included
in this gem and can be installed via the
RSpec Autotest ships with a specialized subclass of Autotest. To use it, just add a
.rspec file to your project's root directory, and run the
autotest command generates a shell command that runs your specs. If you
are using Bundler, and you want the shell command to include
require the Autotest bundler plugin in a
.autotest file in the project's root
directory or your home directory:
# in .autotest require "autotest/bundler"
To use RSpec and Rails with autotest, bring in the
# Gemfile gem 'autotest-rails', :group => [:development, :test]
autotest will now autodetect RSpec and Rails after you run the
generate rspec:install command.
Autotest style autotest/rspec_rspec2 doesn't seem to exist. Aborting.
This happens if you're using rspec-3.x + rspec-autotest-1.x and you still have rspec-core-2.x installed. You have two options to resolve this issue:
- Uninstall rspec-core-2.x (or remove it from the current gemset if you use a tool that supports gemsets).
- Pass a
--styleflag to the
autotestexecutable, which should resolve the version of rspec correctly to 3.x:
autotest --style rspec
Invalid Option: --tty
--tty option was added in rspec-core-2.2.1, and is used
internally by RSpec. If you see an error citing it as an invalid option, you'll
probably see there are two or more versions of rspec-core in the backtrace: one
< 2.2.1 and one >= 2.2.1.
This usually happens because you have a newer rspec-core installed, and an older rspec-core specified in a Bundler Gemfile. If this is the case, you can:
- specify the newer version in the Gemfile (recommended)
- prefix the
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install rspec-autotest
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request