Add 'spring-commands-rspec'
Created by: teddywing
This gem allows RSpec to be used with the Spring preloader, eliminating the Rails startup time when running tests. Was getting really annoyed at the 10-second startup times every time I wanted to run any tests.
Here's a sample comparison running a single test file:
Before:
rspec spec/models/chouette/vehicle_journey_at_stops_day_offset_spec.rb
Run options:
include {:wip=>true}
exclude {:js=>true, :meta=>true}
All examples were filtered out; ignoring {:wip=>true}
...
Finished in 2.01 seconds (files took 9.41 seconds to load)
3 examples, 0 failures
---
After:
spring rspec spec/models/chouette/vehicle_journey_at_stops_day_offset_spec.rb
Running via Spring preloader in process 45340
Run options:
include {:wip=>true}
exclude {:js=>true, :meta=>true}
All examples were filtered out; ignoring {:wip=>true}
...
Finished in 2 seconds (files took 0.76843 seconds to load)
3 examples, 0 failures
When doing TDD this is a huge workflow improvement.
Since the /bin/ directory is ignored by .gitignore, you'll have to
generate the binstub manually to get this working:
$ bundle exec spring binstub rspec
$ git checkout bin/spring # since this file is in the repo but is
$ # also in .gitignore so shouldn't be
$ # committed.
$ bundle exec spring rspec # enjoy!
To use with rspec.vim, add this to your Vim config:
let g:rspec_command = "!bundle exec spring rspec {spec}"