On Sat, Jan 3, 2009 at 6:58 PM, Reza Primardiansyah <
reza.primardians...@gmail.com> wrote:


> I found out that running RSpec on Rails takes too much overhead. It takes
> more than 16s per run although the specs only take less than 6s, like seen
> below.


The killer is the time it takes to load environment.rb, which loads Rails,
runs initializers, etc. The rake spec task also tears down and recreates the
test database, but that's not as significant.

The solution to the first situation is spec_server, which loads the
environment once, then stays in memory as a DRb process. By passing --drb to
the spec command, RSpec will have that process run specs. The solution to
the second situation is to not run rake spec, but instead use spec or
autospec.

All that said, I haven't had as much joy from spec_server as I have in the
past. Too often it seems to not load changed models. But this might be
related to a patch I had to apply to even get it to run. Things seemed to
have changed with Rails 2.2.2 and/or RSpec 1.1.11.

///ark
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to