fn inspect_grant() {
    // Create a temporary file with invalid yaml
    let _text = indoc! {"
         connection:
           type: postgres
           url: postgres://postgres:postgres@localhost:5432/postgres
         roles: []
         users: []
    "};

    let mut file = NamedTempFile::new().expect("failed to create temp file");
    file.write(_text.as_bytes())
        .expect("failed to write to temp file");
    let path = PathBuf::from(file.path().to_str().unwrap());

    let mut cmd = Command::cargo_bin("grant").unwrap();
    cmd.arg("inspect").arg("--file").arg(path);

    // Expect output contains the current user name
    cmd.assert()
        .success()
        .stderr(predicate::str::contains("postgres"));
}
/// grant inspect should print the current user
grant inspect should print the current user
grant inspect should print the current user
fn inspect_grant() {
    // Create a temporary file with invalid yaml
    let _text = indoc! {"
         connection:
           type: postgres
           url: postgres://postgres:postgres@localhost:5432/postgres
         roles: []
         users: []
    "};
    let mut file = NamedTempFile::new().expect("failed to create temp file");
    file.write(_text.as_bytes())
        .expect("failed to write to temp file");
    let path = PathBuf::from(file.path().to_str().unwrap());
    let mut cmd = Command::cargo_bin("grant").unwrap();
    cmd.arg("inspect").arg("--file").arg(path);
    // Expect output contains the current user name
    cmd.assert()
        .success()
        .stderr(predicate::str::contains("postgres"));
}
fn inspect_grant ( ) { // Create a temporary file with invalid yaml let _text = indoc ! { " " } ; let mut file = NamedTempFile :: new ( ) . expect ( " " ) ; file . write ( _text . as_bytes ( ) ) . expect ( " " ) ; let path = PathBuf :: from ( file . path ( ) . to_str ( ) . unwrap ( ) ) ; let mut cmd = Command :: cargo_bin ( " " ) . unwrap ( ) ; cmd . arg ( " " ) . arg ( " " ) . arg ( path ) ; // Expect output contains the current user name cmd . assert ( ) . success ( ) . stderr ( predicate :: str :: contains ( " " ) ) ; }
grant inspect should print the current user
grant inspect should print the current user