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
{{ message }}
This repository was archived by the owner on Feb 18, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 18, 2025. It is now read-only.
Love the project but kinda of a pain to write tests around code that is leveraging this library. Have the team considered making a trait of the Public API's so they can be mocked or replaced with an in memory file system for testing code that uses this library.
Good questions, I believe the best approach might be to have two versions of the API.
First one is the current system that you have, top level functions in the library. This guarantee backwards compatibility with the current users.
The second is having a trait that are the same functions as the the top level functions in the library. Then have an struct container where the struct just implements the trait and delegates the functionality to the top level functions in the library.
So it will look something like this:
Activity
soc commentedon Dec 7, 2022
Is there a good approach that does not impose test-related complexity on regular users?
I'd be all for it.
cjgratacos commentedon Dec 12, 2022
Good questions, I believe the best approach might be to have two versions of the API.
So it will look something like this:
tgross35 commentedon Jan 6, 2024
Maybe this could just check for an env before running
RUST_DIRS_TESTING_USE_PREFIX=/tmp/..., and use it if set.