Skip to content

Commit f470b1c

Browse files
committed
Use Rackup::Handler when available
The `Rack::Handler` was extracted from Rack 3+ into separate `rackup` package.
1 parent 027eb7a commit f470b1c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rb/spec/integration/selenium/webdriver/spec_support/rack_server.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
# under the License.
1919

2020
require 'rack'
21+
begin
22+
require 'rackup'
23+
rescue LoadError
24+
end
2125

2226
module Selenium
2327
module WebDriver
@@ -76,7 +80,7 @@ def handler
7680

7781
handler = handlers.find { |h| load_handler h }
7882
constant = handler == 'webrick' ? 'WEBrick' : handler.capitalize
79-
Rack::Handler.const_get constant
83+
(defined?(Rackup) ? Rackup : Rack)::Handler.const_get(constant)
8084
end
8185

8286
def load_handler(handler)

0 commit comments

Comments
 (0)