Struct goose_eggs::Validate [−][src]
pub struct Validate<'a> { pub status: Option<u16>, pub title: Option<&'a str>, pub texts: Vec<&'a str>, }
Expand description
Define one or more items to be validated in a web page response.
This structure is passed to validate_and_load_static_assets
.
Example
use goose_eggs::Validate; fn example() { let _validate = Validate { // Don't do any extra validation of the status code. status: None, // Be sure the expected title is on the page. title: Some("my page"), // Be sure both of the following strings are found on the page. texts: vec!["foo", r#"<a href="bar">"#], }; }
Fields
status: Option<u16>
If provided, validate the response status code.
title: Option<&'a str>
If provided, validate the response title.
texts: Vec<&'a str>
If provided, validate that the provided texts are found on the page.
Auto Trait Implementations
impl<'a> RefUnwindSafe for Validate<'a>
impl<'a> UnwindSafe for Validate<'a>