Ed Page 79469f3019 refactor(tests): Name init ui tests more consistently
Currently, the UI tests are
- `cargo add`
- `cargo new`
- `cargo remove`
- `init`

One of these is not like the others. This change renames `init` to
`cargo_init` to suggest it is the UI tests for the `cargo init` command,
rather than `init` functionality.
2023-07-24 13:39:37 -05:00

22 lines
528 B
Rust

use cargo_test_support::paths;
use cargo_test_support::prelude::*;
use std::fs;
use cargo_test_support::curr_dir;
#[cargo_test]
fn case() {
let foo = &paths::root().join("foo.bar");
fs::create_dir_all(foo).unwrap();
snapbox::cmd::Command::cargo_ui()
.arg_line("init")
.current_dir(foo)
.assert()
.code(101)
.stdout_matches_path(curr_dir!().join("stdout.log"))
.stderr_matches_path(curr_dir!().join("stderr.log"));
assert!(!foo.join("Cargo.toml").is_file());
}