cargo-open
cargo-open copied to clipboard
Add tests for different kinds of crate installations
In main.rs
, add unit tests for the cargo_dir
function that checks that it returns the correct directory for different kinds of crates that have been installed, like:
- A crate specified with
*
as its version - A crate specified with a particular version
- A crate installed from github
- A crate installed from a local path
- A crate that we have a local override set up for
This may require setting up some infrastructure similar to what cargo does for its tests in order to be able to create temporary directories that contain different kinds of projects.