fn deny_list_works_during_extraction() {
    let srv = MockServer::start();
    let (tmp_dir, file) = setup_tmp_directory(&["LICENSE".to_string()], "wordlist").unwrap();

    let mock = srv.mock(|when, then| {
        when.method(GET).path("/LICENSE");
        then.status(200)
            .body(&srv.url("'/homepage/assets/img/icons/handshake.svg'"));
    });

    let mock_two = srv.mock(|when, then| {
        when.method(GET)
            .path("/homepage/assets/img/icons/handshake.svg");
        then.status(200);
    });

    let cmd = Command::cargo_bin("feroxbuster")
        .unwrap()
        .arg("--url")
        .arg(srv.url("/"))
        .arg("--wordlist")
        .arg(file.as_os_str())
        .arg("--extract-links")
        .arg("--dont-scan")
        .arg(srv.url("/homepage/"))
        .unwrap();

    cmd.assert().success().stdout(
        predicate::str::contains("/LICENSE")
            .and(predicate::str::contains("200"))
            .and(predicate::str::contains("/homepage/assets/img/icons/handshake.svg").not()),
    );

    assert_eq!(mock.hits(), 1);
    assert_eq!(mock_two.hits(), 0);
    teardown_tmp_directory(tmp_dir);
}
/// test that the deny list prevents requests of urls found during extraction
test that the deny list prevents requests of urls found during extraction
test that the deny list prevents requests of urls found during extraction
fn deny_list_works_during_extraction() {
    let srv = MockServer::start();
    let (tmp_dir, file) = setup_tmp_directory(&["LICENSE".to_string()], "wordlist").unwrap();
    let mock = srv.mock(|when, then| {
        when.method(GET).path("/LICENSE");
        then.status(200)
            .body(&srv.url("'/homepage/assets/img/icons/handshake.svg'"));
    });
    let mock_two = srv.mock(|when, then| {
        when.method(GET)
            .path("/homepage/assets/img/icons/handshake.svg");
        then.status(200);
    });
    let cmd = Command::cargo_bin("feroxbuster")
        .unwrap()
        .arg("--url")
        .arg(srv.url("/"))
        .arg("--wordlist")
        .arg(file.as_os_str())
        .arg("--extract-links")
        .arg("--dont-scan")
        .arg(srv.url("/homepage/"))
        .unwrap();
    cmd.assert().success().stdout(
        predicate::str::contains("/LICENSE")
            .and(predicate::str::contains("200"))
            .and(predicate::str::contains("/homepage/assets/img/icons/handshake.svg").not()),
    );
    assert_eq!(mock.hits(), 1);
    assert_eq!(mock_two.hits(), 0);
    teardown_tmp_directory(tmp_dir);
}
fn deny_list_works_during_extraction ( ) { let srv = MockServer :: start ( ) ; let ( tmp_dir , file ) = setup_tmp_directory ( & [ " " . to_string ( ) ] , " " ) . unwrap ( ) ; let mock = srv . mock ( | when , then | { when . method ( GET ) . path ( " " ) ; then . status ( 200 ) . body ( & srv . url ( " " ) ) ; } ) ; let mock_two = srv . mock ( | when , then | { when . method ( GET ) . path ( " " ) ; then . status ( 200 ) ; } ) ; let cmd = Command :: cargo_bin ( " " ) . unwrap ( ) . arg ( " " ) . arg ( srv . url ( " " ) ) . arg ( " " ) . arg ( file . as_os_str ( ) ) . arg ( " " ) . arg ( " " ) . arg ( srv . url ( " " ) ) . unwrap ( ) ; cmd . assert ( ) . success ( ) . stdout ( predicate :: str :: contains ( " " ) . and ( predicate :: str :: contains ( " " ) ) . and ( predicate :: str :: contains ( " " ) . not ( ) ) , ) ; assert_eq ! ( mock hits ( ) 1 ) ; assert_eq ! ( mock_two hits ( ) 0 ) ; teardown_tmp_directory ( tmp_dir ) ; }
test that the deny list prevents requests of urls found during extraction
test that the deny list prevents requests of urls found during extraction