Skip to content

Commit

Permalink
Add tests for ls of strikes
Browse files Browse the repository at this point in the history
  • Loading branch information
tbsklg committed Aug 16, 2024
1 parent 853d3c3 commit 5774b64
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cli-client/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,16 @@ fn add_strike() -> Result<(), Box<dyn std::error::Error>> {

Ok(())
}

#[test]
fn list_strikes() -> Result<(), Box<dyn std::error::Error>> {
let file = assert_fs::NamedTempFile::new("./tests/fixtures/db.json")?;
file.write_str("{\"guenther\": 1}")?;

let mut cmd = Command::cargo_bin("strikes")?;

cmd.arg("--db-path").arg(file.path()).arg("ls");
cmd.assert().success().stdout("{\"guenther\": 1}\n");

Ok(())
}

0 comments on commit 5774b64

Please sign in to comment.