pact-foundation / pact-mock_service

Provides a mock service for use with Pact
https://pact.io
MIT License
72 stars 68 forks source link

Running with Rack > 3.1 gives error `uninitialized constant Rack::Handler` #151

Closed pezholio closed 1 month ago

pezholio commented 1 month ago

Pre issue-raising checklist

I have already:

Software versions

Expected behaviour

Tests pass

Actual behaviour

When running the tests with Rack version >= 3.1.0, the tests fail with the error:

NameError:
    uninitialized constant Rack::Handler

This looks related to changes in Rack starting 3.1.0 - https://github.com/rack/rack/blob/main/CHANGELOG.md#310---2024-06-11

Steps to reproduce

An example build with Rack > 3.1.0 ❌

https://github.com/alphagov/pact-mock_service/actions/runs/9513302857

And example build with Rack < 3.1.0 ✅

https://github.com/alphagov/pact-mock_service/actions/runs/9513330459

Harriethw commented 1 month ago

I've put a fix that worked for me locally here https://github.com/pact-foundation/pact-mock_service/pull/146/files#r1639534752