Add a centralized ui module with Arc's visual identity: colored commit IDs (magenta), bookmarks (cyan), tags (yellow), status symbols, and diff highlighting. Update all command output and tests accordingly.
36 lines
950 B
Rust
36 lines
950 B
Rust
use std::process::Command;
|
|
use tempfile::TempDir;
|
|
|
|
fn arc_cmd() -> Command {
|
|
let mut cmd = Command::new(env!("CARGO_BIN_EXE_arc"));
|
|
cmd.env("NO_COLOR", "1");
|
|
cmd
|
|
}
|
|
|
|
#[test]
|
|
fn init_works_with_arcignore_present() {
|
|
let dir = TempDir::new().unwrap();
|
|
std::fs::write(dir.path().join(".arcignore"), "target/\n*.tmp\n").unwrap();
|
|
|
|
let output = arc_cmd()
|
|
.arg("init")
|
|
.current_dir(dir.path())
|
|
.output()
|
|
.expect("failed to run arc");
|
|
assert!(output.status.success());
|
|
assert!(dir.path().join(".arc").is_dir());
|
|
}
|
|
|
|
#[test]
|
|
fn init_works_with_ignore_present() {
|
|
let dir = TempDir::new().unwrap();
|
|
std::fs::write(dir.path().join(".ignore"), "build/\n").unwrap();
|
|
|
|
let output = arc_cmd()
|
|
.arg("init")
|
|
.current_dir(dir.path())
|
|
.output()
|
|
.expect("failed to run arc");
|
|
assert!(output.status.success());
|
|
assert!(dir.path().join(".arc").is_dir());
|
|
}
|