I want to use the logger functionality from within a Test::Unit::TestCase. Does anyone know how to do this? I''ve tried adding "helper_method :logger" to the class_test.rb class, but that of course does not work. Any ideas?
Shane Sherman wrote:>I want to use the logger functionality from within a >Test::Unit::TestCase. Does anyone know how to do this? I''ve tried >adding "helper_method :logger" to the class_test.rb class, but that of >course does not work. > >Any ideas? > >RAILS_DEFAULT_LOGGER.debug ''blah blah'' Even easier, $stderr.puts ''blah blah''
Or just: warn "blah blah" Flurin Alexey Verkhovsky wrote:> Shane Sherman wrote: > >> I want to use the logger functionality from within a >> Test::Unit::TestCase. Does anyone know how to do this? I''ve tried >> adding "helper_method :logger" to the class_test.rb class, but that of >> course does not work. >> >> Any ideas? >> >> > RAILS_DEFAULT_LOGGER.debug ''blah blah'' > > Even easier, > > $stderr.puts ''blah blah'' > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Shane Sherman <wtf242-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:> I want to use the logger functionality from within a > Test::Unit::TestCase. Does anyone know how to do this? I''ve tried > adding "helper_method :logger" to the class_test.rb class, but that of > course does not work.A little hackish, but I just instantiate an AR based object. Assuming a users.yml and a User object, I often have in my setup: @user = User.find(1) Then I can just call @user.logger.debug or @user.logger.info, etc. -- doug-jGAhs73c5XxeoWH0uzbU5w@public.gmane.org