Skip to content

Commit 270b8ca

Browse files
committed
feat(#197): tests
1 parent 661bfc8 commit 270b8ca

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

cli/tests/integration_test.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,25 @@ mod tests {
4545
Ok(())
4646
}
4747

48+
#[tag("deep")]
49+
#[test]
50+
fn outputs_version() -> Result<()> {
51+
let assertion = Command::cargo_bin("fakehub")?.arg("--version").assert();
52+
let bytes = assertion.get_output().stdout.as_slice();
53+
let output = str::from_utf8(bytes)?;
54+
assert!(output.contains(env!("CARGO_PKG_VERSION")));
55+
Ok(())
56+
}
57+
58+
#[test]
59+
fn outputs_version_from_short() -> Result<()> {
60+
let assertion = Command::cargo_bin("fakehub")?.arg("-v").assert();
61+
let bytes = assertion.get_output().stdout.as_slice();
62+
let output = str::from_utf8(bytes)?;
63+
assert!(output.contains(env!("CARGO_PKG_VERSION")));
64+
Ok(())
65+
}
66+
4867
#[tag("deep")]
4968
#[test]
5069
fn outputs_start_opts() -> Result<()> {

0 commit comments

Comments
 (0)