You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...but there's something that could make it awesome-er!
See, the setup_with_mocks macro is great, but it does not let us execute an on_exit instruction during the mocking, but after it, which in turn makes it awkward to do something like that:
The use case I've come across is my app works with Elasticsearch, and we've dockerized an ES instance that's shared by both the dev and test instances. In order to not destroy the dev index(es) every time the tests run, yet really test real requests, we want to insert data before each test, mocking the index name so we don't use the same as the dev, then destroy the index aterwards.
So, we're just going to destroy the index before the tests run for now (plus it allows us to insure our instance is clean before each tests) but maybe we're not the only ones that need to tear down stuff from time to time, so here's that ;)
If I find how to do it, I'll be sure to post a PR.
The text was updated successfully, but these errors were encountered:
Hi :) awesome lib you've got there...
...but there's something that could make it awesome-er!
See, the
setup_with_mocks
macro is great, but it does not let us execute anon_exit
instruction during the mocking, but after it, which in turn makes it awkward to do something like that:The use case I've come across is my app works with Elasticsearch, and we've dockerized an ES instance that's shared by both the dev and test instances. In order to not destroy the dev index(es) every time the tests run, yet really test real requests, we want to insert data before each test, mocking the index name so we don't use the same as the dev, then destroy the index aterwards.
So, we're just going to destroy the index before the tests run for now (plus it allows us to insure our instance is clean before each tests) but maybe we're not the only ones that need to tear down stuff from time to time, so here's that ;)
If I find how to do it, I'll be sure to post a PR.
The text was updated successfully, but these errors were encountered: