use assert_cmd::prelude::*; use std::{error::Error, path::Path, process::Command}; #[test] #[ignore] fn test_validate() -> Result<(), Box> { Command::cargo_bin("packs")? .arg("--project-root") .arg("tests/fixtures/valid_project") .arg("validate") .assert() .success(); Ok(()) } #[test] #[ignore] fn test_generate() -> Result<(), Box> { Command::cargo_bin("packs")? .arg("--project-root") .arg("tests/fixtures/valid_project") .arg("--codeowners-file-path") .arg("../../../tmp/CODEOWNERS") .arg("generate") .assert() .success(); let expected_codeowners: String = std::fs::read_to_string(Path::new("tests/fixtures/valid_project/.github/CODEOWNERS"))?; let actual_codeowners: String = std::fs::read_to_string(Path::new("tmp/CODEOWNERS"))?; assert_eq!(expected_codeowners, actual_codeowners); Ok(()) }