pub struct DocumentAssertion<'a> { /* private fields */ }Implementations§
Source§impl<'a> DocumentAssertion<'a>
impl<'a> DocumentAssertion<'a>
Sourcepub fn title_matches(self, matcher: TextMatch) -> Self
pub fn title_matches(self, matcher: TextMatch) -> Self
Assert the document title matches a pattern
Sourcepub fn title_is_empty(self) -> Self
pub fn title_is_empty(self) -> Self
Assert the document has no title (empty string)
Sourcepub fn item_count(self, expected: usize) -> Self
pub fn item_count(self, expected: usize) -> Self
Assert the number of items in the document
Sourcepub fn item<F>(self, index: usize, assertion: F) -> Selfwhere
F: FnOnce(ContentItemAssertion<'a>),
pub fn item<F>(self, index: usize, assertion: F) -> Selfwhere
F: FnOnce(ContentItemAssertion<'a>),
Assert on a specific item by index
Sourcepub fn root_location_starts_at(
self,
expected_line: usize,
expected_column: usize,
) -> Self
pub fn root_location_starts_at( self, expected_line: usize, expected_column: usize, ) -> Self
Assert the root session location starts at the given line and column
Sourcepub fn root_location_ends_at(
self,
expected_line: usize,
expected_column: usize,
) -> Self
pub fn root_location_ends_at( self, expected_line: usize, expected_column: usize, ) -> Self
Assert the root session location ends at the given line and column
Sourcepub fn root_location_contains(self, line: usize, column: usize) -> Self
pub fn root_location_contains(self, line: usize, column: usize) -> Self
Assert the root session location contains the given position
Sourcepub fn root_location_excludes(self, line: usize, column: usize) -> Self
pub fn root_location_excludes(self, line: usize, column: usize) -> Self
Assert the root session location does NOT contain the given position
pub fn annotation_count(self, expected: usize) -> Self
pub fn annotation<F>(self, index: usize, assertion: F) -> Selfwhere
F: FnOnce(AnnotationAssertion<'a>),
Auto Trait Implementations§
impl<'a> Freeze for DocumentAssertion<'a>
impl<'a> RefUnwindSafe for DocumentAssertion<'a>
impl<'a> Send for DocumentAssertion<'a>
impl<'a> Sync for DocumentAssertion<'a>
impl<'a> Unpin for DocumentAssertion<'a>
impl<'a> UnsafeUnpin for DocumentAssertion<'a>
impl<'a> UnwindSafe for DocumentAssertion<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more