let files = vec![
create_test_internal_file("test.gmi", FileType::Gemini),
create_test_internal_file(
- &layout_path.to_str().expect("Could not encode layout"),
+ layout_path.to_str().expect("Could not encode layout"),
FileType::Layout,
),
create_test_internal_file("regular.html", FileType::File),
#[test]
fn test_handle_with_layout() {
- let mut handler = FileHandler::default();
- handler.layout = Some("test layout".to_string());
+ let handler = FileHandler {
+ layout: Some("test layout".to_string()),
+ ..Default::default()
+ };
let test_dir = setup_test_dir();
- create_dir_all(&test_dir.join("output_html"))
+ create_dir_all(test_dir.join("output_html"))
.expect("Could not create output html test directory");
- create_dir_all(&test_dir.join("output_gemini"))
+ create_dir_all(test_dir.join("output_gemini"))
.expect("Could not create output gemini test directory");
let test_path = test_dir.join("test.gmi");
create_test_file(&test_path, "");
let file = create_test_internal_file(
- &test_path
+ test_path
.to_str()
.expect("Could not encode gemini test file"),
FileType::Gemini,
create_test_file(&test_dir.join("test1.gmi"), "");
create_test_file(&test_dir.join("test2.gmi"), "");
create_test_file(&test_dir.join("test3.gmi"), "");
- create_dir_all(&test_dir.join("output_html"))
+ create_dir_all(test_dir.join("output_html"))
.expect("Could not create output html test directory");
- create_dir_all(&test_dir.join("output_gemini"))
+ create_dir_all(test_dir.join("output_gemini"))
.expect("Could not create output gemini test directory");
let mut handler = FileHandler::default();
- let files = vec![
+ let files = [
create_test_internal_file(
- &test_dir
+ test_dir
.join("test1.gmi")
.to_str()
.expect("Could not encode test1"),
FileType::Gemini,
),
create_test_internal_file(
- &layout_path.to_str().expect("Could not encode layout"),
+ layout_path.to_str().expect("Could not encode layout"),
FileType::Layout,
),
create_test_internal_file(
- &test_dir
+ test_dir
.join("test2.gmi")
.to_str()
.expect("Could not encode test2"),
FileType::Gemini,
),
create_test_internal_file(
- &test_dir
+ test_dir
.join("test3.gmi")
.to_str()
.expect("Could not encode test3"),