rodalies-cli 1.0.0

CLI for searching train timetables of the trains of Rodalies de la Generalitat de Catalunya
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[cfg(test)]
mod tests {
    use assert_cmd::prelude::*; // Add methods on commands
    use predicates::prelude::*; // Used for writing assertions
    use std::process::Command; // Run programs

    #[test]
    fn cli_call_no_interactive_without_args() -> Result<(), Box<dyn std::error::Error>> {
        let mut cmd = Command::cargo_bin("rodalies-cli").unwrap();
        cmd.arg("--from=0");

        cmd.assert().failure().stderr(predicate::str::contains(
            "Please, specify origin and destination station IDs",
        ));

        Ok(())
    }
}