aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/commands/server_test.rb
diff options
context:
space:
mode:
authorMarc Schütz <schuetzm@gmx.net>2013-10-12 20:27:13 +0200
committerMarc Schütz <schuetzm@gmx.net>2013-10-13 19:21:18 +0200
commit16c0023a9a14688bbc96d81e809bd26ccf651438 (patch)
treedbe6e0e52ef6be636a4b1d0347daf10d89c98287 /railties/test/commands/server_test.rb
parent365110196afcf952bc22729d4467d579b708328f (diff)
downloadrails-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.rb60
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