Search code examples
ruby-on-railsrubyrspecspork

Spork won't reload file in lib


I'm running rspec with spork and I can't get a file in lib to reload on consecutive rspec runs. I've tried require'ing the file in 'Spork.each_run'

I'm not getting any responses, so I'll try to explain further. I have the following files in my Rails app:

  • lib/car.rb
  • spec/lib/car_spec.rb

To run tests, first I start spork then run 'rspec spec/lib/car_spec.rb'

RSpec is not seeing my changes to my Car class, unless I restart spork.

Any help?

I'm on:

  • rails 3.1.0.rc6
  • rspec 2.6.0
  • spork 0.9.0.rc9

Solution

  • You should put car.rb in app/models.