Make tests use .parse instead of Html.
This commit is contained in:
		
							parent
							
								
									2b944b57af
								
							
						
					
					
						commit
						0f0b044993
					
				| 
						 | 
					@ -1,11 +1,10 @@
 | 
				
			||||||
use std::fs::read_to_string;
 | 
					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]
 | 
					#[test]
 | 
				
			||||||
fn test_group_parsing() {
 | 
					fn test_group_parsing() {
 | 
				
			||||||
  let html = read_to_string("tests/samples/group.html").unwrap();
 | 
					  let html = read_to_string("tests/samples/group.html").unwrap();
 | 
				
			||||||
  let html = Html::parse_document(&html);
 | 
					  let group = &html.parse::<Group>().unwrap();
 | 
				
			||||||
  let group = Group::from_html(&html).unwrap();
 | 
					 | 
				
			||||||
  assert_debug_snapshot!(group);
 | 
					  assert_debug_snapshot!(group);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,11 +1,10 @@
 | 
				
			||||||
use std::fs::read_to_string;
 | 
					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]
 | 
					#[test]
 | 
				
			||||||
fn test_group_list_parsing() {
 | 
					fn test_group_list_parsing() {
 | 
				
			||||||
  let html = read_to_string("tests/samples/group_list.html").unwrap();
 | 
					  let html = read_to_string("tests/samples/group_list.html").unwrap();
 | 
				
			||||||
  let html = Html::parse_document(&html);
 | 
					  let group_list = html.parse::<GroupList>().unwrap();
 | 
				
			||||||
  let group_list = GroupList::from_html(&html).unwrap();
 | 
					 | 
				
			||||||
  assert_debug_snapshot!(group_list);
 | 
					  assert_debug_snapshot!(group_list);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in New Issue