pub struct TempTestEnv { /* private fields */ }Expand description
Creates a temporary test environment in which files and directories can be prepared and checked against after the test ran.
Implementations§
Source§impl TempTestEnv
impl TempTestEnv
Sourcepub fn run(
setup: impl FnOnce(&mut Setup) -> &mut Setup,
test: impl FnOnce(&Path),
expect: impl FnOnce(&mut Expect) -> &mut Expect,
)
pub fn run( setup: impl FnOnce(&mut Setup) -> &mut Setup, test: impl FnOnce(&Path), expect: impl FnOnce(&mut Expect) -> &mut Expect, )
Create a test enviroment and run the given test in it.
The given closures for setup and expect set up the test environment
and configure the expected end state respectively.
Sourcepub fn run_no_check(
setup: impl FnOnce(&mut Setup) -> &mut Setup,
test: impl FnOnce(&Path),
)
pub fn run_no_check( setup: impl FnOnce(&mut Setup) -> &mut Setup, test: impl FnOnce(&Path), )
Create a test enviroment and run the given test in it.
This is the same as TempTestEnv::run, but does not check the
resulting directory structure.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TempTestEnv
impl RefUnwindSafe for TempTestEnv
impl Send for TempTestEnv
impl Sync for TempTestEnv
impl Unpin for TempTestEnv
impl UnwindSafe for TempTestEnv
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