diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-01-20 16:11:10 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-08-08 07:47:11 +0900 |
commit | f2173648938b418d120f5a68d8f3862d8ae9dace (patch) | |
tree | 189ab54e40d4b3d3f861c0c58b3d332cd07f918a /railties/test/application | |
parent | 6b0d59895ccaf81767a0243eb166d59a36e1ab5a (diff) | |
download | rails-f2173648938b418d120f5a68d8f3862d8ae9dace.tar.gz rails-f2173648938b418d120f5a68d8f3862d8ae9dace.tar.bz2 rails-f2173648938b418d120f5a68d8f3862d8ae9dace.zip |
Deprecate support of older `config.ru`
Since Rails 4.0, `config.ru` generated by default uses instances of
`Rails.application`. Therefore, I think that it is good to deprecate
the old behavior.
Related: #9669
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/server_test.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/railties/test/application/server_test.rb b/railties/test/application/server_test.rb new file mode 100644 index 0000000000..07880a5025 --- /dev/null +++ b/railties/test/application/server_test.rb @@ -0,0 +1,31 @@ +require "isolation/abstract_unit" +require "rails/command" +require "rails/commands/server/server_command" + +module ApplicationTests + class ServerTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + + def setup + build_app + end + + def teardown + teardown_app + end + + test "deprecate support of older `config.ru`" do + remove_file "config.ru" + app_file "config.ru", <<-RUBY + require_relative 'config/environment' + run AppTemplate::Application + RUBY + + server = Rails::Server.new(config: "#{app_path}/config.ru") + server.app + + log = File.read(Rails.application.config.paths["log"].first) + assert_match(/DEPRECATION WARNING: Use `Rails::Application` subclass to start the server is deprecated/, log) + end + end +end |