pub struct Context { /* private fields */ }Expand description
A test context that groups related tests together.
Implementations§
Source§impl Context
impl Context
Sourcepub fn scope(
&mut self,
name: impl Into<SharedString>,
build: impl FnOnce(&mut Context),
)
pub fn scope( &mut self, name: impl Into<SharedString>, build: impl FnOnce(&mut Context), )
Creates a new child context with a given scope name.
Sourcepub fn test(
&mut self,
name: impl Into<SharedString>,
test: impl Start<Result> + Send + 'static,
)
pub fn test( &mut self, name: impl Into<SharedString>, test: impl Start<Result> + Send + 'static, )
Adds a test to the context.
Sourcepub fn start(self) -> OutputStream
pub fn start(self) -> OutputStream
Starts the tests in this context, returning an OutputStream for
receiving the results.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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