diff options
Diffstat (limited to 'rust/hello/tests/cli.rs')
| -rw-r--r-- | rust/hello/tests/cli.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/rust/hello/tests/cli.rs b/rust/hello/tests/cli.rs new file mode 100644 index 0000000..a69010f --- /dev/null +++ b/rust/hello/tests/cli.rs @@ -0,0 +1,19 @@ +use assert_cmd::Command; + +#[test] +fn runs() { + let mut cmd = Command::cargo_bin("hello").unwrap(); + cmd.assert().success().stdout("Hello, world!\n"); +} + +#[test] +fn true_ok() { + let mut cmd = Command::cargo_bin("true").unwrap(); + cmd.assert().success(); +} + +#[test] +fn false_not_ok() { + let mut cmd = Command::cargo_bin("false").unwrap(); + cmd.assert().failure(); +} |
