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
Let's say I use an external library that provides an HTTP Client, like a trait SpotifyClient with some basic implementations. I want to mock the responses of the client and verify the requests made in order to test some logic that my code does (as a large integration test).
Currently, from the examples, you can only add mocks using the #[mock_it] or #[cfg_attr(mock_it)] directives, which cannot be added on external code...
Is there any other utilities I can use from this library to overcome this issue? Because I really like the simplicity and directness of the API 😄
Would the solution be to create an implementation classe, like struct FakeSpotifyClient, that implements the SpotifyClient trait but with todo!()s, and add the #[mock_it] directive to it?
The text was updated successfully, but these errors were encountered:
Let's say I use an external library that provides an HTTP Client, like a
trait SpotifyClient
with some basic implementations. I want to mock the responses of the client and verify the requests made in order to test some logic that my code does (as a large integration test).Currently, from the examples, you can only add mocks using the
#[mock_it]
or#[cfg_attr(mock_it)]
directives, which cannot be added on external code...Is there any other utilities I can use from this library to overcome this issue? Because I really like the simplicity and directness of the API 😄
Would the solution be to create an implementation classe, like
struct FakeSpotifyClient
, that implements theSpotifyClient
trait but withtodo!()
s, and add the#[mock_it]
directive to it?The text was updated successfully, but these errors were encountered: