Skip to content

Commit cd43ac0

Browse files
committed
test: add first integration test
1 parent 9cb547e commit cd43ac0

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

Cargo.lock

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@ globset = "0.4.16"
5858

5959
[dev-dependencies]
6060
assert_cmd = "2.0.17"
61+
predicates = "3.1.3"

tests/cli_integration_tests.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use assert_cmd::Command;
2+
use predicates::str::is_match;
3+
4+
#[test]
5+
fn test_version_subcommand() {
6+
// Arrange / Act
7+
let assertion = Command::cargo_bin("cotp")
8+
.unwrap()
9+
.arg("--version")
10+
.assert();
11+
12+
// Assert
13+
assertion
14+
.success()
15+
.stdout(is_match("^cotp \\d+\\.\\d+\\.\\d+-DEBUG-.+").unwrap());
16+
}

0 commit comments

Comments
 (0)