David Rice
2007-Aug-04 00:40 UTC
Override the default rails ''rake test'' command to start dependencies
Hey guys, I''d like to be able to override the default test task with something that starts the dependencies required for testing our app. I''ve been googling a bit and playing around with rake but I can''t get it to play ball. I put a file in lib/tasks/testing.rake with the following command. Does anyone know a solution for doing something like this? I''m sure this must be a common thing :) Thanks, Dave desc ''Test all units and functionals'' task :test do puts "Starting ferret server..." system "RAILS_ENV=test script/ferret_start" exceptions = ["test:units", "test:functionals", "test:integration"].collect do |task| begin Rake::Task[task].invoke nil rescue => e e end end.compact exceptions.each {|e| puts e;puts e.backtrace } raise "Test failures" unless exceptions.empty? end --- David Rice http://www.davidjrice.co.uk --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Glaesemann
2007-Aug-04 01:52 UTC
Re: Override the default rails ''rake test'' command to start dependencies
On Aug 3, 2007, at 19:40 , David Rice wrote:> I''d like to be able to override the default test task with something > that starts the dependencies required for testing our app.I''ve found this useful in the past for redefining tasks (third item when I google for "rake redefine tasks") http://snippets.dzone.com/posts/show/2032 Michael Glaesemann grzm seespotcode net --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
David Rice
2007-Aug-04 19:59 UTC
Re: Override the default rails ''rake test'' command to start dependencies
Excellent, thanks Michael just what I was looking for! I guess redefine was the magic word I didn''t try. :) On Aug 4, 2:52 am, Michael Glaesemann <g...-RYEyMNgfJnVLeUupdtUFmg@public.gmane.org> wrote:> On Aug 3, 2007, at 19:40 , David Rice wrote: > > > I''d like to be able to override the default test task with something > > that starts the dependencies required for testing our app. > > I''ve found this useful in the past for redefining tasks (third item > when I google for "rake redefine tasks") > > http://snippets.dzone.com/posts/show/2032 > > Michael Glaesemann > grzm seespotcode net--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---