From 0f0b0449930bb7a98a231f549fb81dbce38cec28 Mon Sep 17 00:00:00 2001 From: Bauke Date: Sun, 16 Oct 2022 18:09:04 +0200 Subject: [PATCH] Make tests use .parse instead of Html. --- tests/group.rs | 5 ++--- tests/group_list.rs | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/group.rs b/tests/group.rs index 8d9ce4f..ea7735f 100644 --- a/tests/group.rs +++ b/tests/group.rs @@ -1,11 +1,10 @@ use std::fs::read_to_string; -use {insta::assert_debug_snapshot, scraper::Html, tildes_parser::Group}; +use {insta::assert_debug_snapshot, tildes_parser::Group}; #[test] fn test_group_parsing() { let html = read_to_string("tests/samples/group.html").unwrap(); - let html = Html::parse_document(&html); - let group = Group::from_html(&html).unwrap(); + let group = &html.parse::().unwrap(); assert_debug_snapshot!(group); } diff --git a/tests/group_list.rs b/tests/group_list.rs index 7acbe1d..a512df4 100644 --- a/tests/group_list.rs +++ b/tests/group_list.rs @@ -1,11 +1,10 @@ use std::fs::read_to_string; -use {insta::assert_debug_snapshot, scraper::Html, tildes_parser::GroupList}; +use {insta::assert_debug_snapshot, tildes_parser::GroupList}; #[test] fn test_group_list_parsing() { let html = read_to_string("tests/samples/group_list.html").unwrap(); - let html = Html::parse_document(&html); - let group_list = GroupList::from_html(&html).unwrap(); + let group_list = html.parse::().unwrap(); assert_debug_snapshot!(group_list); }