Clean (fmt et remove useless code) integration test
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
162c6aeb2d
commit
1172331ba4
|
@ -3,16 +3,10 @@
|
||||||
mod integration {
|
mod integration {
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::process::Output;
|
|
||||||
|
|
||||||
static WITHOUT_ARGS_OUTPUT: &'static str = " USAGE:
|
|
||||||
carman [FLAGS] [OPTIONS] <URL>
|
|
||||||
For more information try --help
|
|
||||||
";
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn calling_carman_without_args_returns_result() {
|
fn calling_carman_without_args_returns_result() {
|
||||||
let output = Command::new("./target/debug/carman")
|
let output = Command::new("./target/debug/carman")
|
||||||
.output()
|
.output()
|
||||||
.expect("failed to execute process");
|
.expect("failed to execute process");
|
||||||
let re = Regex::new(r"^Hello").unwrap();
|
let re = Regex::new(r"^Hello").unwrap();
|
||||||
|
@ -21,7 +15,7 @@ mod integration {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn calling_carman_with_help_returns_usage() {
|
fn calling_carman_with_help_returns_usage() {
|
||||||
let output = Command::new("./target/debug/carman")
|
let output = Command::new("./target/debug/carman")
|
||||||
.arg("--help")
|
.arg("--help")
|
||||||
.output()
|
.output()
|
||||||
.expect("failed to execute process");
|
.expect("failed to execute process");
|
||||||
|
@ -30,5 +24,4 @@ mod integration {
|
||||||
let re = Regex::new(r"--help").unwrap();
|
let re = Regex::new(r"--help").unwrap();
|
||||||
assert!(re.is_match(&String::from_utf8_lossy(&output.stdout)));
|
assert!(re.is_match(&String::from_utf8_lossy(&output.stdout)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue