pact-foundation / pact-ruby

Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://pact.io
MIT License
2.17k stars 216 forks source link

Pact creating conflict when using Minitest on Rails 7.1 #302

Closed psantos10 closed 10 months ago

psantos10 commented 12 months ago

I tried to upgrade a Rails app from 7.0.8 to Rails 7.1.2 and Pact start creating issues related with RSpec, even when I am using Minitest

The error:

Error: OperationResultTest::#target_type#test_0001_should be set to configured value after initialize for new record: RSpec::Mocks::OutsideOfExampleError: The use of doubles or partial doubles from rspec-mocks outside of the per-test lifecycle is not supported.

I am not using Rspec. And looking into Gemfile.lock, I see that Pact is the one introducing rspec. So I decided to disable pact, and my tests are green.

bethesque commented 11 months ago

Thanks for letting me know. Unfortunately, I can't do much with that report. Please provide the steps to reproduce, the full logs, and the stacktrace.

psantos10 commented 10 months ago

I am not sure what I did exactly, but a bunch of adjustments on the code fixed it. Not sure which specific adjust was the that solved the issue.