Skip to content

Commit

Permalink
Update use of rack vs rackup
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahchen6 committed Nov 11, 2024
1 parent 347bc45 commit d7f13c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spec/datadog/tracing/contrib/suite/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

require 'rack'
# `Rack::Handler::WEBrick` was extracted to the `rackup` gem in Rack 3.0
require 'rackup' if Gem::Version.new(Rack::RELEASE) >= Gem::Version.new('3')
require 'rackup/handler/webrick' if Gem::Version.new(Rack::RELEASE) >= Gem::Version.new('3')
require 'webrick'

RSpec.describe 'contrib integration testing', :integration do
Expand Down Expand Up @@ -164,7 +164,11 @@ def build(*dynamic_configurations)
end
end.to_app

server.mount '/', Rack::Handler::WEBrick, app
if Gem::Version.new(Rack::RELEASE) >= Gem::Version.new('3')
server.mount '/', Rackup::Handler::WEBrick, app
else
server.mount '/', Rack::Handler::WEBrick, app
end

@thread = Thread.new { server.start }
try_wait_until { started }
Expand Down

0 comments on commit d7f13c8

Please sign in to comment.