X-Git-Url: https://git.r.bdr.sh/rbdr/page/blobdiff_plain/d9f6d3c1536092c832c399c1dbe5e05f712a006e..2cbae13cfd94f48dfe9a8c903e05aea49106b778:/src/file_handler/file_strategies/file.rs diff --git a/src/file_handler/file_strategies/file.rs b/src/file_handler/file_strategies/file.rs index 7e95adf..603d189 100644 --- a/src/file_handler/file_strategies/file.rs +++ b/src/file_handler/file_strategies/file.rs @@ -56,6 +56,12 @@ mod tests { let strategy = Strategy {}; assert!(strategy.is(&test_dir.join("image.png"))); assert!(strategy.is(&test_dir.join("style.css"))); + } + + #[test] + fn rejects_directories() { + let test_dir = setup_test_dir(); + let strategy = Strategy {}; assert!(!strategy.is(&test_dir)); } @@ -66,9 +72,14 @@ mod tests { } #[test] - fn handles_correct_file_type() { + fn handles_file_type() { let strategy = Strategy {}; assert!(strategy.can_handle(&FileType::File)); + } + + #[test] + fn rejects_non_file_types() { + let strategy = Strategy {}; assert!(!strategy.can_handle(&FileType::Layout)); assert!(!strategy.can_handle(&FileType::Gemini)); assert!(!strategy.can_handle(&FileType::Unknown));