The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
DB population: more autotest vs. rake issues.

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ryan Davis

Posts: 651
Nickname: zenspider
Registered: Oct, 2004

Ryan Davis is a ruby nerd.
DB population: more autotest vs. rake issues. Posted: Jun 22, 2007 11:58 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Ryan Davis.
Original Post: DB population: more autotest vs. rake issues.
Feed Title: Polishing Ruby
Feed URL: http://blog.zenspider.com/index.rdf
Feed Description: Musings on Ruby and the Ruby Community...
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Ryan Davis
Latest Posts From Polishing Ruby

Advertisement

I use autotest almost exclusively. It is very rare that I run tests via rake these days so it is embarrassing when something fails via rake and not via autotest. It makes me look bad.

My latest snafu was regarding fixtures. See, the project prepopulates the test db and I started migrating them away from using the fixture calls they were using. When I use my typical rake nuke rule, it'll scrap and rebuild everything, including repopulating the db. autotest is happy as a clam. But rails' test:units does a prepare each time, nuking anything we put in there. I've seen a lot of weird hacks to deal with this, but I just came up with one I finally like:

# ensure we always populate the test db
%w(units functionals integration).each do |type|
  Rake::Task["test:#{type}"].prerequisites.push "db:test:populate"
end

db:test:populate is up to you, do what you need to do. For us, it just ensures we do a db:fixtures:load with RAILS_ENV=test.

This way, no matter HOW you run your tests, either by default rule or by specifying one of the phases you're interested in, you'll always do that populate.

Read: DB population: more autotest vs. rake issues.

Topic: "Emoji" Previous Topic   Next Topic Topic: The Who's Who of the Frugos Unconference

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use