diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-03-30 03:17:49 -0300 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2016-03-30 03:17:49 -0300 |
commit | 6065f0ee78c460b5a35448a83211e2a0a9b66251 (patch) | |
tree | b31cc37249b76d6e908c57746019857698ea38fa /railties/test | |
parent | afba03f79c9e3e88fbb9e38dbb905546f16f0d9e (diff) | |
parent | 9d87ce34f865fa9d7a24ef9f1f1b0d4dedfd3fbf (diff) | |
download | rails-6065f0ee78c460b5a35448a83211e2a0a9b66251.tar.gz rails-6065f0ee78c460b5a35448a83211e2a0a9b66251.tar.bz2 rails-6065f0ee78c460b5a35448a83211e2a0a9b66251.zip |
Merge pull request #24331 from prathamesh-sonpatki/fix-puma-restart
Fix rails restart issue with Puma
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/rake/dev_test.rb | 9 | ||||
-rw-r--r-- | railties/test/application/rake/restart_test.rb | 9 | ||||
-rw-r--r-- | railties/test/commands/server_test.rb | 14 |
3 files changed, 32 insertions, 0 deletions
diff --git a/railties/test/application/rake/dev_test.rb b/railties/test/application/rake/dev_test.rb index 59b46c6e79..deb9bc8dee 100644 --- a/railties/test/application/rake/dev_test.rb +++ b/railties/test/application/rake/dev_test.rb @@ -29,6 +29,15 @@ module ApplicationTests assert_match(/Development mode is no longer being cached/, output) end end + + test 'dev:cache removes server.pid also' do + Dir.chdir(app_path) do + FileUtils.mkdir_p("tmp/pids") + FileUtils.touch("tmp/pids/server.pid") + `rake dev:cache` + assert_not File.exist?("tmp/pids/server.pid") + end + end end end end diff --git a/railties/test/application/rake/restart_test.rb b/railties/test/application/rake/restart_test.rb index 4cae199e6b..30f662a9be 100644 --- a/railties/test/application/rake/restart_test.rb +++ b/railties/test/application/rake/restart_test.rb @@ -34,6 +34,15 @@ module ApplicationTests assert File.exist?('tmp/restart.txt') end end + + test 'rake restart removes server.pid also' do + Dir.chdir(app_path) do + FileUtils.mkdir_p("tmp/pids") + FileUtils.touch("tmp/pids/server.pid") + `rake restart` + assert_not File.exist?("tmp/pids/server.pid") + end + end end end end 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 |