Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'script/console test' with spork and rspec not loading the whole environment?

I'm trying to load up console to interact with some of my rspec mocking helpers. I expected that running script/console test would load an env similar to when I run spec. However, this doesn't appear to be the case. It looks like spec_helper is never loaded. Or, if it is, it's not actually running through the logic because spork has polluted it a bit.

In short, is there a quick and easy way to get an interactive rspec party going?

like image 818
Dane O'Connor Avatar asked Jun 07 '10 04:06

Dane O'Connor


1 Answers

You can load rspec with the following once the console is loaded:

require "#{RAILS_ROOT}/spec/spec_helper"

like image 191
vrish88 Avatar answered Sep 30 '22 17:09

vrish88