Closed Wesmania closed 3 years ago
Ah thank you so much! This totally works!
I had forgotten that I had implemented an "Exhausted" state to the mocks so they didn't get "consumed" anymore, it is always just by &mut
which lets you do the Mutex<Arc<Mock>>
!
I will be merging this soon, I just want to make sure I fully grok it first (:
I did some minor cosmetic tweaks to the tests, mostly for my own benefit for readability later (:
Thanks a lot!
This makes mocks no longer panic, while making sure that calling individual mocked methods does not lock the entire mock. For convenience, the mutex is moved inside MockStore.
Fixes #35.
Signed-off-by: Igor Kotrasinski i.kotrasinsk@gmail.com