clingwrap 0.7.0

types and functions to implement command line programs
Documentation
//! Tests for SSH functionality. These require password-less acces
//! to `localhost`.

use clingwrap::ssh::*;

#[test]
fn run_true() {
    let mut ssh = Ssh::new("localhost", Args::from(vec!["true"])).command();
    let output = ssh.output();
    println!("{output:?}");
    assert!(output.unwrap().status.success());
}

#[test]
fn run_false() {
    let mut ssh = Ssh::new("localhost", Args::from(vec!["false"])).command();
    let output = ssh.output();
    println!("{output:?}");
    assert!(!output.unwrap().status.success());
}

#[test]
fn hello_world() {
    let mut ssh = Ssh::new("localhost", Args::from(vec!["echo", "hello,", "world"])).command();
    let output = ssh.output().unwrap();
    assert!(output.status.success());
    assert_eq!(String::from_utf8_lossy(&output.stdout), "hello, world\n");
}