Heh - you nailed it with banging rocks together. I'm still playing with these, I don't know what to do either:
#[cfg(test)] mod tests { use super::*; use flate2::read::ZlibDecoder; use hyper::body; use select::{ document::Document, predicate::{Name, Predicate}, }; use tokio::runtime::Runtime; #[test] fn test_four_oh_four() { let mut rt = Runtime::new().unwrap(); let response = rt.block_on(four_oh_four()).unwrap(); let bytes = rt.block_on(body::to_bytes(response)).unwrap(); let mut d = ZlibDecoder::new(&bytes[..]); let mut html = String::new(); d.read_to_string(&mut html).unwrap(); let document = Document::from(html.as_str()); let node = document .find(Name("main").descendant(Name("h1"))) .next() .unwrap(); assert_eq!(node.text(), "NOT FOUND!"); } }
That made me feel better - misery loves company!
I'm planning to include a fuller set with the forthcoming CRUD template, I'll copy the relevant ones back over.
They may not be pretty, but at least they'll be there...
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Heh - you nailed it with banging rocks together. I'm still playing with these, I don't know what to do either:
That made me feel better - misery loves company!
I'm planning to include a fuller set with the forthcoming CRUD template, I'll copy the relevant ones back over.
They may not be pretty, but at least they'll be there...