forked from Crockan/MercuryToolbox
chore(release): prepare public source release
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
//! Integration tests for the `proctree` command.
|
||||
|
||||
use assert_cmd::Command;
|
||||
use predicates::prelude::*;
|
||||
|
||||
fn cargo_command() -> Command {
|
||||
Command::cargo_bin("proctree").expect("binary")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reports_rooted_run_tree_as_json() {
|
||||
let mut command = cargo_command();
|
||||
command
|
||||
.arg("run")
|
||||
.arg("--json")
|
||||
.arg("--")
|
||||
.arg("pwsh")
|
||||
.arg("-NoProfile")
|
||||
.arg("-Command")
|
||||
.arg("Start-Process pwsh -ArgumentList '-NoProfile','-Command','Start-Sleep -Milliseconds 800' -PassThru | Out-Null; Start-Sleep -Milliseconds 200")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(predicate::str::contains("\"root_pid\""))
|
||||
.stdout(predicate::str::contains("\"nodes\""))
|
||||
.stdout(predicate::str::contains("\"image_name\":\"pwsh.exe\""));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn help_includes_proctree_examples() {
|
||||
let mut command = cargo_command();
|
||||
command
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(predicate::str::contains("system"))
|
||||
.stdout(predicate::str::contains("root <PID>"))
|
||||
.stdout(predicate::str::contains("ConvertFrom-Json"));
|
||||
}
|
||||
Reference in New Issue
Block a user