aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-08-08 15:10:31 -0400
committerGitHub <noreply@github.com>2017-08-08 15:10:31 -0400
commit21c9c5782e0eaf00769e01164e73d3fa6d3709ac (patch)
tree5346e312df76dc825120534e254437815266d6a2 /railties/test
parent1422e9f9c90462c10d1b0abe6f63f4f6639a8bc3 (diff)
parentf2173648938b418d120f5a68d8f3862d8ae9dace (diff)
downloadrails-21c9c5782e0eaf00769e01164e73d3fa6d3709ac.tar.gz
rails-21c9c5782e0eaf00769e01164e73d3fa6d3709ac.tar.bz2
rails-21c9c5782e0eaf00769e01164e73d3fa6d3709ac.zip
Merge pull request #30127 from y-yagi/deprecate_support_of_older_config_ru
Deprecate support of older `config.ru`
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/server_test.rb31
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