More tests, collect more data, and refactor some code.

This commit is contained in:
2019-02-07 11:42:19 +01:00
parent 20e41d8f65
commit 7f12e84acc
13 changed files with 1240 additions and 160 deletions

View File

@@ -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: []"###);
}
}