carols10cents/cargo-open

Add a test for trying to run `cargo open` without a `Cargo.toml`

Open

#9 建立於 2015年10月4日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)Rust (21 star) (5 fork)user submission
E-easyhelp wanted

描述

In main.rs, add a unit test for the cargo_dir function that checks that it panics if we try to run this command in a directory that doesn't have a Cargo.toml and thus would have no idea where to look to figure out where that crate might be!

Use the existing test marked should_panic for an example of how to make a test check that a function panics.

I doubt that this test will pass currently! Eventually, I'd like this to panic with a message like "Cannot find Cargo.toml file in the current directory" or similar.

貢獻者指南