Skip to main content

ConsumableFixture

Trait ConsumableFixture 

Source
pub trait ConsumableFixture: Sized {
    // Required method
    fn set_up() -> Result<Self>;
}
Expand description

Interface for structure to be set up before the test case. Types implementing ConsumableFixture can be passed by value to a test function.

strct MyFixture { ... }

impl ConsumableFixture for MyFixture { ... }

#[gtest]
fn test_with_fixture(my_fixture: MyFixture) {...}

Required Methods§

Source

fn set_up() -> Result<Self>

Factory method of the ConsumableFixture.

This method is called by the test harness before the test case. If this method returns an Err(...), then the test case is not evaluated.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§