[][src]Trait spekt::Test

pub trait Test where
    Self: Sized + Send + Sync
{ type Error: Display + Send + Sync; #[must_use] fn before<'async_trait>(
    ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
    where
        Self: 'async_trait
; #[must_use] fn after<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn test<'async_trait, F, T>(
        task: T
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        F: Future<Output = Result<(), Self::Error>> + Send,
        T: Send + Sync + FnOnce(Arc<Self>) -> F,
        F: 'async_trait,
        T: 'async_trait,
        Self: Send + 'async_trait
, { ... } }

Test-running trait to handle test lifecycles

Associated Types

type Error: Display + Send + Sync[src]

The format-able error shared by each step. anyhow::Error is recommended!

Loading content...

Required methods

#[must_use]fn before<'async_trait>(
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>> where
    Self: 'async_trait, 
[src]

Initialize test suite with new instance of test's state

Loading content...

Provided methods

#[must_use]fn after<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: Sync + 'async_trait, 
[src]

Optionally clean up after test run

#[must_use]fn test<'async_trait, F, T>(
    task: T
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    F: Future<Output = Result<(), Self::Error>> + Send,
    T: Send + Sync + FnOnce(Arc<Self>) -> F,
    F: 'async_trait,
    T: 'async_trait,
    Self: Send + 'async_trait, 
[src]

Run a Result-emitting test task, handling assertion errors gracefully

Loading content...

Implementors

Loading content...