From: Ruben Beltran del Rio Date: Sat, 4 Jan 2025 01:24:02 +0000 (+0100) Subject: Fix test X-Git-Tag: 1.4.0~5 X-Git-Url: https://git.r.bdr.sh/rbdr/page/commitdiff_plain/3a7229d55bb1091a2bdd5d7fcd87f1c82d0a734a?hp=36a5c232b1f5d86bf97e29af987862732556ee07 Fix test --- diff --git a/src/file_handler/file_strategies/file.rs b/src/file_handler/file_strategies/file.rs index e5573a2..363f712 100644 --- a/src/file_handler/file_strategies/file.rs +++ b/src/file_handler/file_strategies/file.rs @@ -90,14 +90,13 @@ mod tests { create_dir_all(&source_dir).expect("Could not create source test directory"); create_dir_all(&output_dir).expect("Could not create output test directory"); create_test_file(&source_dir.join("image.png"), "A fish playing the banjo"); - let strategy = Strategy {}; let file = File { path: source_dir.join("image.png"), file_type: FileType::File, }; - strategy.handle(&source_dir, &output_dir, &file); + Strategy::handle(&source_dir, &output_dir, &file); let copied_path = &output_dir.join("image.png"); assert!(copied_path.exists()); @@ -120,14 +119,13 @@ mod tests { &source_dir.join("nested/style.css"), "* { margin: 0; padding: 0 }", ); - let strategy = Strategy {}; let file = File { path: source_dir.join("nested/style.css"), file_type: FileType::File, }; - strategy.handle(&source_dir, &output_dir, &file); + Strategy::handle(&source_dir, &output_dir, &file); let copied_path = output_dir.join("nested/style.css"); assert!(copied_path.exists()); diff --git a/tests/cli_test.rs b/tests/cli_test.rs index fcbdb99..641d6f7 100644 --- a/tests/cli_test.rs +++ b/tests/cli_test.rs @@ -21,8 +21,8 @@ fn test_basic_generation() { let test_dir = setup_test_dir(); let dir_name = test_dir.file_name().unwrap().to_string_lossy(); let parent = test_dir.parent().unwrap(); - let html_dir = parent.join(format!("{}_html", dir_name)); - let gemini_dir = parent.join(format!("{}_gemini", dir_name)); + let html_dir = parent.join(format!("{dir_name}_html")); + let gemini_dir = parent.join(format!("{dir_name}_gemini")); let _cleanup = TestDir { paths: vec![test_dir.clone(), html_dir.clone(), gemini_dir.clone()], @@ -97,8 +97,8 @@ fn test_missing_layout() { let test_dir = setup_test_dir(); let dir_name = test_dir.file_name().unwrap().to_string_lossy(); let parent = test_dir.parent().unwrap(); - let html_dir = parent.join(format!("{}_html", dir_name)); - let gemini_dir = parent.join(format!("{}_gemini", dir_name)); + let html_dir = parent.join(format!("{dir_name}_html")); + let gemini_dir = parent.join(format!("{dir_name}_gemini")); let _cleanup = TestDir { paths: vec![test_dir.clone(), html_dir.clone(), gemini_dir.clone()],