use assert_cmd::Command;
use predicates::prelude::*;

#[test]
fn help_mentions_core_flags() {
    let mut command = Command::cargo_bin("port-killer").unwrap();

    command
        .arg("--help")
        .assert()
        .success()
        .stdout(predicate::str::contains("--dry-run"))
        .stdout(predicate::str::contains("--json"))
        .stdout(predicate::str::contains("--yes"));
}

#[test]
fn requires_a_port_or_dev_mode() {
    let mut command = Command::cargo_bin("port-killer").unwrap();

    command
        .assert()
        .failure()
        .stderr(predicate::str::contains("provide at least one port"));
}
