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 ?
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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.