mirror of
https://github.com/epi052/feroxbuster.git
synced 2026-04-19 06:31:13 -03:00
31 lines
834 B
Rust
31 lines
834 B
Rust
mod utils;
|
|
use assert_cmd::cargo_bin;
|
|
use assert_cmd::prelude::*;
|
|
use httpmock::MockServer;
|
|
use predicates::prelude::*;
|
|
use std::process::Command;
|
|
use utils::{setup_tmp_directory, teardown_tmp_directory};
|
|
|
|
#[test]
|
|
/// send a single valid request, expect a 200 response
|
|
fn read_in_config_file_for_settings() -> Result<(), Box<dyn std::error::Error>> {
|
|
let srv = MockServer::start();
|
|
|
|
let (tmp_dir, file) = setup_tmp_directory(&["threads = 37".to_string()], "ferox-config.toml")?;
|
|
|
|
Command::new(cargo_bin!("feroxbuster"))
|
|
.current_dir(&tmp_dir)
|
|
.arg("--url")
|
|
.arg(srv.url("/"))
|
|
.arg("--wordlist")
|
|
.arg(file.as_os_str())
|
|
.arg("-vvvv")
|
|
.assert()
|
|
.success()
|
|
.stderr(predicate::str::contains("│ 37"));
|
|
|
|
teardown_tmp_directory(tmp_dir);
|
|
|
|
Ok(())
|
|
}
|