Skip to content

Commit

Permalink
add eprint test
Browse files Browse the repository at this point in the history
Signed-off-by: Phil Prasek <[email protected]>
  • Loading branch information
prasek committed May 28, 2021
1 parent e40f5aa commit d7b2c92
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ thiserror = "1.0"

[dev-dependencies]
version-sync = "0.9"
assert_cmd = "1.0.1"
predicates = "1.0.8"

[[example]]
name = "alignment"
Expand Down
12 changes: 12 additions & 0 deletions tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
use assert_cmd::Command;
use predicates::prelude::*;

#[test]
fn test_readme_deps() {
version_sync::assert_markdown_deps_updated!("README.md");
Expand All @@ -7,3 +10,12 @@ fn test_readme_deps() {
fn test_html_root_url() {
version_sync::assert_html_root_url_updated!("src/lib.rs");
}

#[test]
fn test_eprint() {
let mut cmd = Command::cargo_bin("examples/hello_world").unwrap();

// running the CLI with no command returns to std err
let result = cmd.assert();
result.stderr(predicate::str::contains("Hello, World!"));
}

0 comments on commit d7b2c92

Please sign in to comment.