From b7d9d6e2cd5082d269dafbc0316e2107febe1451 Mon Sep 17 00:00:00 2001 From: Terence Lee Date: Fri, 15 Mar 2013 04:07:22 -0700 Subject: make new rails apps log to STDOUT --- railties/test/application/configuration_test.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'railties/test/application') diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 7b45623f6c..40000b0ce6 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -670,5 +670,26 @@ module ApplicationTests end end end + + test "set logger to STDOUT by default" do + stdout = capture(:stdout) do + app = build_app + + controller :omg, <<-RUBY + class OmgController < ApplicationController + def index + Rails.logger.info "HI MOM" + render text: "omg" + end + end + RUBY + + require "#{app_path}/config/environment" + + get "/omg/index" + end + + assert stdout.include?("HI MOM"), "STDOUT does not include 'HI MOM', #{stdout}" + end end end -- cgit v1.2.3