Skip to content

Commit

Permalink
Fix CI with latest Rack
Browse files Browse the repository at this point in the history
Older versions provided backwards compatibility, but with the new major
version of rack, this has gone away.
  • Loading branch information
smortex committed Jun 19, 2024
1 parent a034cdc commit ce01a18
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/riemann/tools/http_check_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
require 'openssl'
begin
require 'rackup/handler/webrick'
RACK_HANDLER = Rackup::Handler::WEBrick
rescue LoadError
# XXX: Needed for Ruby 2.6 compatibility
# Moved to the rackup gem in recent versions
require 'rack/handler/webrick'
RACK_HANDLER = Rack::Handler::WEBrick
end
require 'sinatra/base'
require 'webrick'
Expand Down Expand Up @@ -108,7 +110,7 @@ def protected!
Logger: WEBrick::Log.new(File.open(File::NULL, 'w')),
}
@server = WEBrick::HTTPServer.new(server_options)
@server.mount('/', Rack::Handler::WEBrick, TestWebserver)
@server.mount('/', RACK_HANDLER, TestWebserver)
@started = false
Thread.new { @server.start }
Timeout.timeout(1) { sleep(0.1) until @started }
Expand Down Expand Up @@ -260,7 +262,7 @@ def protected!
SSLCertName: '/CN=example.com',
}
@server = WEBrick::HTTPServer.new(server_options)
@server.mount('/', Rack::Handler::WEBrick, TestWebserver)
@server.mount('/', RACK_HANDLER, TestWebserver)
@started = false
Thread.new { @server.start }
Timeout.timeout(1) { sleep(0.1) until @started }
Expand Down

0 comments on commit ce01a18

Please sign in to comment.