Struct TestBuilder

Source
pub struct TestBuilder<'module, 'func> { /* private fields */ }
Expand description

Constructs a Test

Implementations§

Source§

impl<'module, 'func> TestBuilder<'module, 'func>

Source

pub fn new(module: &'module TestModule, name: &'static str) -> Self

Source

pub fn build(self) -> Test<'module, 'func>

Builds the test and initializes it.

Source

pub fn using_fixture_dir(self) -> Self

Configures this test to use an existing fixture directory. The base path is defined by the parent Module or Group, with an existing subdirectory expected to be the name of this test.

Source

pub fn using_temp_dir(self) -> Self

Configures the test to use a temporary directory. The base path is defined by the parent Module or Group, with a subdirectory created just for this test (by its name).

Source

pub fn inherit_temp_dir(self) -> Self

Configures the test to use the exact same temporary directory as its parent Module or Group. A separate subdirectory will not be created for this test.

Source

pub fn inherit_fixture_dir(self) -> Self

Configures the test to use the exact same fixture directory as its parent Module or Group. A separate subdirectory for this test is not expected to exist.

Source

pub fn setup(self, func: impl FnOnce(&mut Test<'_, '_>) + 'func) -> Self

Calls the provided function once on construction of the test.

Source

pub fn teardown(self, func: impl FnOnce(&mut Test<'_, '_>) + 'func) -> Self

Calls the provided function once on destruction of the test.

Auto Trait Implementations§

§

impl<'module, 'func> Freeze for TestBuilder<'module, 'func>

§

impl<'module, 'func> !RefUnwindSafe for TestBuilder<'module, 'func>

§

impl<'module, 'func> !Send for TestBuilder<'module, 'func>

§

impl<'module, 'func> !Sync for TestBuilder<'module, 'func>

§

impl<'module, 'func> Unpin for TestBuilder<'module, 'func>

§

impl<'module, 'func> !UnwindSafe for TestBuilder<'module, 'func>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V