I want to speed up my model tests. After seeing this
http://iain.nl/testing-activerecord-in-isolation, I thought it could
be achieved if i can only require the active_record rather than
loading the spec_helper.rb, which loads the whole Rails stack for
every test file.

I am using rspec-rails with factory_girl.

But so far its not working for me. Every time i run a single file the
whole migrations are getting run, which is not acceptable.And before
the whole migrations run i am getting some errors.


Anybody have a better idea?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Jordon Bedwell at Nov 26, 2012 at 2:30 pm

    On Mon, Nov 26, 2012 at 7:58 AM, venkata reddy wrote:
    Anybody have a better idea?
    Don't run rspec command? Use Guard and keep on developing letting it
    tell you when tests fail and pass rather than caring about the 1
    second, it's inefficient to stop and run rspec when you can let Guard
    do it and backtrack, because at least then you didn't waste the
    seconds going to the terminal, typing the command, waiting and then
    crying (not that you cried but I would - actually, I would probably
    flip a table while crying like a baby because I would be mad I not
    only had to wait but that a test failed.)

    You can also use Guard + Spork or just Spork which will preload your
    entire Rails app switching up changed pieces making your tests run
    faster, but note that Spork breaks SimpleCov (by design, probably not
    by intention as kinda implied by the massive ticket discussion -- at
    least to me.) To me losing SimpleCov was a big no-no so I developed
    the aforementioned attitude where I develop and keep on developing
    backtracking as I need to (because Guard says a test failed) rather
    than waiting and fixing and wasting time.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedNov 26, '12 at 1:58p
activeNov 26, '12 at 2:30p
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Venkata reddy: 1 post Jordon Bedwell: 1 post

People

Translate

site design / logo © 2021 Grokbase