I am upgrading a Rails 6.1.4 application from Ruby 2.6.10 to Ruby 2.7.6. With Ruby 2.7.6, WebMock no longer matches the Regular Expressions that worked perfectly in 2.6.10.
I am using the latest version of the WebMock gem (3.14.0) in both cases, as well as the latest versions of the required gems, for both the Ruby 2.6.10 and the Ruby 2.7.6 implementations.
Comparing the stub_requests created under Ruby 2.6.10 those created under Ruby 2.7.6, I am seeing no differences.
I have looked through the Ruby 2.7 change notes and am not seeing anything that gives me any indication on what changed that could impact.
Originally, I had experienced this problem upgrading to Ruby 3.0.4, but experimented with 2.7.6 and see that this is where the problem appears to be introduced.
Looking through the Gemfile, I am not seeing anything that looks like it could be causing the problem.
When I replace the RegEx text with hard-coded values, the stubs are found, but this kinda kills the flexibility of using RegEx.
Any suggestions on where I could look to find out why RegEx is no longer working?
The root cause was that the headers has changed between Ruby 2.6 and 2.7 and I had to update the expected header.