-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recommended Webmock integration is incorrect #100
Comments
Hmmm, maybe that's because you disable the mocking in a In such case, the
Yes, not very convenient :/ |
How would that help if the As to our setup,
|
So should we wrap all the stubs in a method you would call in your Something like: |
@redox sounds like a good approach. |
I am facing a similar issue. What is a recommended way to mock all algolia requests across the test suite? |
Hey,
I think the recommended webmock setup in https://github.com/algolia/algoliasearch-client-ruby#mocking does not work in case of multiple test files because
require
will only load the code once. I think the stubs needs to be loaded in every test. Here is what I am doing instead:The key difference is that I do
load
instead ofrequire
. Unfortunately doingload 'algolia/webmock'
did not just work so I had to use$LOADED_FEATURES.find{|x| x.include?("algolia/version.rb") }.gsub("version.rb", "webmock.rb")
to find the file and load it.I need to do it in every affected test.
The text was updated successfully, but these errors were encountered: