Skip to content

Commit

Permalink
tests: use assert_cmd and predicates instead of assert_cli
Browse files Browse the repository at this point in the history
The assert_cli is said to be deprecated: assert-rs/assert_cli#41
  • Loading branch information
Mingshen Sun committed Jul 13, 2018
1 parent a4d6e33 commit 105839f
Show file tree
Hide file tree
Showing 8 changed files with 307 additions and 259 deletions.
112 changes: 87 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ rustyline = { git = "https://github.com/kkawakam/rustyline", optional = true }
tempfile = "3.0.2"
libc = "0.2.40"
lazy_static = "1.0.1"
assert_cli = "0.6.2"
assert_cmd = "0.5.0"
predicates = "0.5.1"

[profile.release]
lto = true
Expand Down
33 changes: 17 additions & 16 deletions tests/gnu/test_arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,35 @@
// For a copy, see the LICENSE file.
//

use assert_cli;
use std::process::Command;
use assert_cmd::prelude::*;

#[test]
#[cfg(target_arch = "x86_64")]
fn test_x86_64() {
new_cli!()
.succeeds()
.and()
.stdout().is("x86_64\n")
.unwrap();
new_cmd!()
.assert()
.success()
.stdout("x86_64\n")
.stderr("");
}

#[test]
#[cfg(target_arch = "arm")]
fn test_arm() {
new_cli!()
.succeeds()
.and()
.stdout().is("arm\n")
.unwrap();
new_cmd!()
.assert()
.success()
.stdout("arm\n")
.stderr("");
}

#[test]
#[cfg(target_arch = "aarch64")]
fn test_aarch64() {
new_cli!()
.succeeds()
.and()
.stdout().is("aarch64\n")
.unwrap();
new_cmd!()
.assert()
.success()
.stdout("aarch64\n")
.stderr("");
}
Loading

0 comments on commit 105839f

Please sign in to comment.