diff --git a/tests/test_banner.rs b/tests/test_banner.rs index 96d8a4f0..2bbabd4e 100644 --- a/tests/test_banner.rs +++ b/tests/test_banner.rs @@ -1487,6 +1487,61 @@ fn banner_prints_force_recursion() { ); } +#[test] +/// test allows non-existent wordlist to trigger the banner printing to stderr +/// expect to see all mandatory prints + scan-dir-listings +fn banner_prints_scan_dir_listings() { + Command::cargo_bin("feroxbuster") + .unwrap() + .arg("--url") + .arg("http://localhost") + .arg("--scan-dir-listings") + .arg("--wordlist") + .arg("/definitely/doesnt/exist/0cd7fed0-47f4-4b18-a1b0-ac39708c1676") + .assert() + .success() + .stderr( + predicate::str::contains("─┬─") + .and(predicate::str::contains("Target Url")) + .and(predicate::str::contains("http://localhost")) + .and(predicate::str::contains("Threads")) + .and(predicate::str::contains("Wordlist")) + .and(predicate::str::contains("Status Codes")) + .and(predicate::str::contains("Timeout (secs)")) + .and(predicate::str::contains("User-Agent")) + .and(predicate::str::contains("Scan Dir Listings")) + .and(predicate::str::contains("─┴─")), + ); +} + +#[test] +/// test allows non-existent wordlist to trigger the banner printing to stderr +/// expect to see all mandatory prints + protocol +fn banner_prints_protocol() { + Command::cargo_bin("feroxbuster") + .unwrap() + .arg("--url") + .arg("localhost") + .arg("--protocol") + .arg("http") + .arg("--wordlist") + .arg("/definitely/doesnt/exist/0cd7fed0-47f4-4b18-a1b0-ac39708c1676") + .assert() + .success() + .stderr( + predicate::str::contains("─┬─") + .and(predicate::str::contains("Target Url")) + .and(predicate::str::contains("http://localhost")) + .and(predicate::str::contains("Threads")) + .and(predicate::str::contains("Wordlist")) + .and(predicate::str::contains("Status Codes")) + .and(predicate::str::contains("Timeout (secs)")) + .and(predicate::str::contains("User-Agent")) + .and(predicate::str::contains("Default Protocol")) + .and(predicate::str::contains("─┴─")), + ); +} + #[test] /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + force recursion diff --git a/tests/test_policies.rs b/tests/test_policies.rs index 1de65ddd..9849d7df 100644 --- a/tests/test_policies.rs +++ b/tests/test_policies.rs @@ -58,7 +58,7 @@ fn auto_bail_cancels_scan_with_timeouts() { Command::cargo_bin("feroxbuster") .unwrap() .arg("--url") - .arg(&srv.url("/")) + .arg(srv.url("/")) .arg("--wordlist") .arg(file.as_os_str()) .arg("--auto-bail")