More tests, collect more data, and refactor some code.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use scraper::{Html, Selector};
|
||||
|
||||
use crate::probe::{Entry, Probe};
|
||||
use crate::entry::Entry;
|
||||
use crate::probe::Probe;
|
||||
|
||||
fn from_html(document: &str) -> Result<Entry, ()> {
|
||||
let html = Html::parse_document(document);
|
||||
@@ -156,4 +157,15 @@ mod tests {
|
||||
- 0 denna vecka och 1 totalt.
|
||||
comments: []"###);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_0546780862() {
|
||||
let document = include_str!("../../fixtures/eniro/0546780862.html");
|
||||
|
||||
assert_yaml_snapshot_matches!(from_html(&document), @r###"Ok:
|
||||
messages:
|
||||
- Nya Wermlands-Tidningens AB
|
||||
history: []
|
||||
comments: []"###);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user