made tests more specific

This commit is contained in:
epi
2020-11-19 14:25:25 -06:00
parent 3c41573db2
commit b1b9ea71de

View File

@@ -96,7 +96,7 @@ fn filters_lines_should_filter_response() {
.not()
.and(predicate::str::contains("200"))
.not()
.and(predicate::str::contains("34"))
.and(predicate::str::contains("2l"))
.not(),
);
@@ -145,7 +145,7 @@ fn filters_words_should_filter_response() {
.not()
.and(predicate::str::contains("200"))
.not()
.and(predicate::str::contains("34"))
.and(predicate::str::contains("13w"))
.not(),
);
@@ -194,7 +194,7 @@ fn filters_size_should_filter_response() {
.not()
.and(predicate::str::contains("200"))
.not()
.and(predicate::str::contains("34"))
.and(predicate::str::contains("56c"))
.not(),
);
@@ -203,48 +203,3 @@ fn filters_size_should_filter_response() {
teardown_tmp_directory(tmp_dir);
}
// #[test]
// /// create a FeroxResponse that should elicit a true from
// /// LinesFilter::should_filter_response
// fn filters_lines_should_filter_response() {
// let srv = MockServer::start();
// let (tmp_dir, file) =
// setup_tmp_directory(&["LICENSE".to_string(), "file.js".to_string()], "wordlist").unwrap();
//
// let mock = Mock::new()
// .expect_method(GET)
// .expect_path("/LICENSE")
// .return_status(302)
// .return_body("this is a test")
// .create_on(&srv);
//
// let mock_two = Mock::new()
// .expect_method(GET)
// .expect_path("/file.js")
// .return_status(200)
// .return_body("this is also a test of some import\nwith 2 lines, no less")
// .create_on(&srv);
//
// let cmd = Command::cargo_bin("feroxbuster")
// .unwrap()
// .arg("--url")
// .arg(srv.url("/"))
// .arg("--wordlist")
// .arg(file.as_os_str())
// .arg("--filter-lines")
// .arg("2")
// .unwrap();
//
// cmd.assert().success().stdout(
// predicate::str::contains("/LICENSE")
// .and(predicate::str::contains("302"))
// .and(predicate::str::contains("14"))
// .and(predicate::str::contains("/file.js")).not()
// .and(predicate::str::contains("200")).not()
// .and(predicate::str::contains("34")).not(),
// );
//
// assert_eq!(mock.times_called(), 1);
// assert_eq!(mock_two.times_called(), 1);
// teardown_tmp_directory(tmp_dir);
// }