Skip to main content

Fixture

Trait Fixture 

Source
pub trait Fixture {
    type Output;

    // Required methods
    fn set_up(&mut self) -> Result<Self::Output>;
    fn tear_down(&mut self) -> Result<()>;
}
Expand description

A trait for any fixture that can be set up and torn down.

Implementors should ensure that tear_down is idempotent and that set_up followed by tear_down always returns the system to a clean state.

Required Associated Types§

Source

type Output

Output produced when the fixture is set up.

Required Methods§

Source

fn set_up(&mut self) -> Result<Self::Output>

Set the fixture up. Returns the output (e.g. a path, a handle).

Source

fn tear_down(&mut self) -> Result<()>

Tear the fixture down. MUST be idempotent.

Implementors§