diff options
author | Marc Schütz <schuetzm@gmx.net> | 2013-10-12 20:27:13 +0200 |
---|---|---|
committer | Marc Schütz <schuetzm@gmx.net> | 2013-10-13 19:21:18 +0200 |
commit | 16c0023a9a14688bbc96d81e809bd26ccf651438 (patch) | |
tree | dbe6e0e52ef6be636a4b1d0347daf10d89c98287 /railties/test/commands/server_test.rb | |
parent | 365110196afcf952bc22729d4467d579b708328f (diff) | |
download | rails-16c0023a9a14688bbc96d81e809bd26ccf651438.tar.gz rails-16c0023a9a14688bbc96d81e809bd26ccf651438.tar.bz2 rails-16c0023a9a14688bbc96d81e809bd26ccf651438.zip |
Make logging to stdout work again with implicit `development` env
Diffstat (limited to 'railties/test/commands/server_test.rb')
-rw-r--r-- | railties/test/commands/server_test.rb | 60 |
1 files changed, 48 insertions, 12 deletions
diff --git a/railties/test/commands/server_test.rb b/railties/test/commands/server_test.rb index 20afca2618..ba688f1e9e 100644 --- a/railties/test/commands/server_test.rb +++ b/railties/test/commands/server_test.rb @@ -27,26 +27,62 @@ class Rails::ServerTest < ActiveSupport::TestCase end def test_environment_with_rails_env - with_rails_env 'production' do - server = Rails::Server.new - assert_equal 'production', server.options[:environment] + with_rack_env nil do + with_rails_env 'production' do + server = Rails::Server.new + assert_equal 'production', server.options[:environment] + end end end def test_environment_with_rack_env - with_rack_env 'production' do - server = Rails::Server.new - assert_equal 'production', server.options[:environment] + with_rails_env nil do + with_rack_env 'production' do + server = Rails::Server.new + assert_equal 'production', server.options[:environment] + end end end def test_log_stdout - args = ["-e", "development"] - options = Rails::Server::Options.new.parse!(args) - assert_equal true, options[:log_stdout] + with_rack_env nil do + with_rails_env nil do + args = [] + options = Rails::Server::Options.new.parse!(args) + assert_equal true, options[:log_stdout] - args = ["-e", "production"] - options = Rails::Server::Options.new.parse!(args) - assert_equal false, options[:log_stdout] + args = ["-e", "development"] + options = Rails::Server::Options.new.parse!(args) + assert_equal true, options[:log_stdout] + + args = ["-e", "production"] + options = Rails::Server::Options.new.parse!(args) + assert_equal false, options[:log_stdout] + + with_rack_env 'development' do + args = [] + options = Rails::Server::Options.new.parse!(args) + assert_equal true, options[:log_stdout] + end + + with_rack_env 'production' do + args = [] + options = Rails::Server::Options.new.parse!(args) + assert_equal false, options[:log_stdout] + end + + with_rails_env 'development' do + args = [] + options = Rails::Server::Options.new.parse!(args) + assert_equal true, options[:log_stdout] + end + + with_rails_env 'production' do + args = [] + options = Rails::Server::Options.new.parse!(args) + assert_equal false, options[:log_stdout] + end + end + end end end |