Testing assert_cmd::cargo_bin使用不同目录中的cargo.toml

Testing assert_cmd::cargo_bin使用不同目录中的cargo.toml,testing,rust,command-line-interface,Testing,Rust,Command Line Interface,因此,我正在开发一个CLI,其中包含如下命令: sandwich [command] create <destination> - Creates a Rust library at the specified destination to act as the sandwich. eat - Used from within a library to eat the sandwich. 在上面的示例中,我得到以下错误: ---- create_sandwich_then_eat

因此,我正在开发一个CLI,其中包含如下命令:

sandwich [command]

create <destination> - Creates a Rust library at the specified destination to act as the sandwich.
eat - Used from within a library to eat the sandwich.
在上面的示例中,我得到以下错误:

---- create_sandwich_then_eat_it stdout ----
Error: CargoError { cause Some(CargoError { kind: CommandFailed, context: Some("error: failed to parse manifest ...etc
我看了一下文档,它说,
cargo\u bin
从当前目录运行命令,因为我改到了三明治目录,那里有一个cargo.toml,我假设它试图从那里运行一些不存在的东西


我知道这不是一个错误,因为它正在做它应该做的事情,但是有没有一种方法可以完成我想做的事情,不管有没有它?

完整的错误信息是什么?完整的错误信息是什么?