Alexander Gitter
2010-Nov-22 19:45 UTC
Rake test picks up logger configuration from my development.rb
Hi, I recently added "config.logger = Logger.new(STDOUT)" to my development.rb and noticed that "rake test" suddenly prints SQL queries to the console as well. I then added "config.logger Logger.new("/dev/null")" to test.rb, but that didn''t help the issue. Aren''t the tests supposed to use the configuration from the test environment? Or should the test target be run with explicitly specifying RAILS_ENV=test ? Regards, Alex -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Nov-23 11:02 UTC
Re: Rake test picks up logger configuration from my development.rb
On Nov 22, 7:45 pm, Alexander Gitter <qwertz1...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Hi, > > I recently added "config.logger = Logger.new(STDOUT)" to my > development.rb and noticed that "rake test" suddenly prints SQL > queries to the console as well. I then added "config.logger > Logger.new("/dev/null")" to test.rb, but that didn''t help the issue. > > Aren''t the tests supposed to use the configuration from the test > environment? >Yes, however my recollection is that when you run rake it starts first in development mode to do stuff like clone the development database structure (if you''re using the sql schema dumper) and so on before running the tests themselves. Fred>Or should the test target be run with explicitly specifying > RAILS_ENV=test ? > > Regards, > Alex-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.