diff options
author | Prathamesh Sonpatki <csonpatki@gmail.com> | 2016-03-30 10:41:41 +0530 |
---|---|---|
committer | Prathamesh Sonpatki <csonpatki@gmail.com> | 2016-03-30 11:20:15 +0530 |
commit | 9d87ce34f865fa9d7a24ef9f1f1b0d4dedfd3fbf (patch) | |
tree | b31cc37249b76d6e908c57746019857698ea38fa /railties/test/commands | |
parent | afba03f79c9e3e88fbb9e38dbb905546f16f0d9e (diff) | |
download | rails-9d87ce34f865fa9d7a24ef9f1f1b0d4dedfd3fbf.tar.gz rails-9d87ce34f865fa9d7a24ef9f1f1b0d4dedfd3fbf.tar.bz2 rails-9d87ce34f865fa9d7a24ef9f1f1b0d4dedfd3fbf.zip |
Fix rails restart issue with Puma
- We need to pass the restart command to Puma so that it will use it
while restarting the server.
- Also made sure that all the options passed by user while starting
the server are used in the generated restart command so that they will
be used while restarting the server.
- Besides that we need to remove the server.pid file for the previous running
server because otherwise Rack complains about it's presence.
- We don't care if the server.pid file does not exist. We only want to delete
it if it exists.
- This also requires some changes on Puma side which are being tracked
here - https://github.com/puma/puma/pull/936.
- Fixes #23910.
Diffstat (limited to 'railties/test/commands')
-rw-r--r-- | railties/test/commands/server_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/test/commands/server_test.rb b/railties/test/commands/server_test.rb index 964b9a44de..38a1605d1f 100644 --- a/railties/test/commands/server_test.rb +++ b/railties/test/commands/server_test.rb @@ -118,4 +118,18 @@ class Rails::ServerTest < ActiveSupport::TestCase assert_equal old_default_options, server.default_options end end + + def test_restart_command_contains_customized_options + original_args = ARGV.dup + args = ["-p", "4567"] + ARGV.replace args + + options = Rails::Server::Options.new.parse! args + server = Rails::Server.new options + expected = "bin/rails server -p 4567" + + assert_equal expected, server.default_options[:restart_cmd] + ensure + ARGV.replace original_args + end end |