Skip to content

Commit

Permalink
fix(test): allow rack 2/3 via RACK_VERSION to fix x509 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Jun 25, 2024
1 parent 5dc44f4 commit a814838
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ Gemfile.lock
gemfiles/*.gemfile.lock
reports/pacts
spec/examples.txt
*bethtest*
*bethtest*
.DS_Store
7 changes: 6 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,10 @@ end
group :test do
gem 'faraday', '~>2.0'
gem 'faraday-retry', '~>2.0'
gem 'rackup', '~> 2.1'
if ENV['RACK_VERSION'] == '2'
gem 'rack', '>= 2.0', '< 3.0'
else
gem 'rack', '>= 3.0', '< 4.0'
gem 'rackup', '~> 2.0'
end
end
4 changes: 3 additions & 1 deletion spec/support/ssl_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ def webrick_opts port
require "rack"
begin
require "rackup/handler/webrick" # rack 3
PactWEBrick = Rackup::Handler::WEBrick
rescue LoadError
require "rack/handler/webrick" # rack 2
PactWEBrick = Rack::Handler::WEBrick
end

opts = webrick_opts(4444)

Rack::Handler::WEBrick.run(app, **opts) do |server|
PactWEBrick.run(app, **opts) do |server|
@server = server
end
end

0 comments on commit a814838

Please sign in to comment.