Replies: 1 comment 1 reply
-
Easy problem. You did |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm attempting to mock a function in an external crate in my library. Mocking works fine in unit tests, but it's failing in integration tests.
I have a test case showing this behavior here:
https://github.com/jgerrish/mockall-mock-external-fn-in-integration-test
The external function I'm mocking is the crossterm read function, found in the namespace:
crossterm::event::read
We created a wrapper using automock and double in src/lib.rs for read in the crossterm and event modules, similar to the ffi example in the mockall library. There is no associated struct.
This works for the unit tests. But trying to move tests to integration tests fails.
The errors we're getting are either
no mock_event
incrossterm
or
cannot find function
read_context
in moduleevent
I found some cases to remove those errors, but the mocking fails and calls the normal crossterm library function.
I'm not sure if I'm failing to reference the correct namespace or module, or what the issue is.
Thank you for any help,
Josh
Beta Was this translation helpful? Give feedback.
All reactions