logo
pub trait World: Sized + 'static {
    type Error: Display;

    fn new<'async_trait>(
    ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + 'async_trait>>
   where
        Self: 'async_trait
; fn collection() -> Collection<Self>
   where
        Self: Debug + WorldInventory
, { ... } fn cucumber<I: AsRef<Path>>(
    ) -> Cucumber<Self, Basic, I, Basic<Self>, Summarize<Normalize<Self, Basic>>>
   where
        Self: Debug + WorldInventory
, { ... } fn run<'async_trait, I>(
        input: I
    ) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>
   where
        Self: Debug + WorldInventory,
        I: 'async_trait + AsRef<Path>,
        Self: 'async_trait
, { ... } fn filter_run<'async_trait, I, F>(
        input: I,
        filter: F
    ) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>
   where
        Self: Debug + WorldInventory,
        I: AsRef<Path>,
        F: Fn(&Feature, Option<&Rule>, &Scenario) -> bool + 'static,
        I: 'async_trait,
        F: 'async_trait,
        Self: 'async_trait
, { ... } }
Expand description

Represents a shared user-defined state for a Cucumber run. It lives on per-scenario basis.

This crate doesn’t provide out-of-box solution for managing state shared across scenarios, because we want some friction there to avoid tests being dependent on each other. If your workflow needs a way to share state between scenarios (ex. database connection pool), we recommend using once_cell crate or organize it other way via shared state.

Required Associated Types

Error of creating a new World instance.

Required Methods

Creates a new World instance.

Provided Methods

Available on crate feature macros only.

Returns runner for tests with auto-wired steps marked by given, when and then attributes.

Available on crate feature macros only.

Returns default Cucumber with all the auto-wired Steps.

Available on crate feature macros only.

Runs Cucumber.

Features sourced by Parser are fed into Runner where the later produces events handled by Writer.

Panics

If encountered errors while parsing Features or at least one Step panicked.

Available on crate feature macros only.

Runs Cucumber with Scenarios filter.

Features sourced by Parser are fed into Runner where the later produces events handled by Writer.

Panics

If encountered errors while parsing Features or at least one Step panicked.

Implementors