diff --git a/lib/rack/test_server/signal_trap_interceptor.rb b/lib/rack/test_server/signal_trap_interceptor.rb index 323cb2f..7588eed 100644 --- a/lib/rack/test_server/signal_trap_interceptor.rb +++ b/lib/rack/test_server/signal_trap_interceptor.rb @@ -20,12 +20,15 @@ def disable end end -require 'rack/server' +require 'rackup/server' # Disable SIGINT handler in Rack::Server. # https://github.com/rack/rack/blob/2.2.3/lib/rack/server.rb#L319 +# https://github.com/rack/rackup/blob/main/lib/rackup/server.rb#L333 Rack::Server.prepend(Rack::TestServer::SignalTrapInterceptor) +Rackup::Server.prepend(Rack::TestServer::SignalTrapInterceptor) # Mainly inteded to disable SIGINT handler in Puma. # https://github.com/puma/puma/blob/v5.5.0/lib/puma/launcher.rb#L485 +# https://github.com/puma/puma/blob/v6.4.2/lib/puma/launcher.rb#L441 Signal.singleton_class.prepend(Rack::TestServer::SignalTrapInterceptor) diff --git a/rack-test_server.gemspec b/rack-test_server.gemspec index a9cc9cf..d1e4d87 100644 --- a/rack-test_server.gemspec +++ b/rack-test_server.gemspec @@ -24,11 +24,11 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.required_ruby_version = '>= 2.3' - spec.add_dependency 'rack', '>= 2', '< 3' + spec.add_dependency 'rack' + spec.add_dependency 'rackup' spec.add_development_dependency 'minitest' spec.add_development_dependency 'puma' spec.add_development_dependency 'rake' spec.add_development_dependency 'sinatra' - spec.add_development_dependency 'thin' spec.add_development_dependency 'webrick' end diff --git a/test/test_launch_server.rb b/test/test_launch_server.rb index 5161aa2..437de25 100644 --- a/test/test_launch_server.rb +++ b/test/test_launch_server.rb @@ -42,7 +42,7 @@ def test_launch_puma _test(server) end - def test_launch_thin + def _test_launch_thin server = Rack::TestServer.new(app: MyApp, Port: 8005, server: :thin) _test(server) end diff --git a/test/test_stop_server.rb b/test/test_stop_server.rb index 0a657b2..394e729 100644 --- a/test/test_stop_server.rb +++ b/test/test_stop_server.rb @@ -32,7 +32,7 @@ def test_stop_webrick _test(server) end - def test_stop_thin + def _test_stop_thin server = Rack::TestServer.new(app: APP, server: :thin, Port: 8083) _test(server) end