logo

Trait cucumber::writer::Summarizable[][src]

pub trait Summarizable { }
Expand description

Marker indicating that a Writer can be wrapped into a Summarize.

Not any Writer can be wrapped into a Summarize, as it may transform events inside and the summary won’t reflect outputted events correctly.

So, this trait ensures that a wrong Writers pipeline cannot be build.

Example

MyWorld::cucumber()
    .with_writer(
        // `Writer`s pipeline is constructed in a reversed order.
        writer::Basic::stdout()
            .fail_on_skipped() // Fails as `Summarize` will count skipped
            .summarized()      // steps instead of failed.
    )
    .run_and_exit("tests/features/readme")
    .await;
MyWorld::cucumber()
    .with_writer(
        // `Writer`s pipeline is constructed in a reversed order.
        writer::Basic::stdout() // And, finally, print them.
            .summarized()       // Only then, count summary for them.
            .fail_on_skipped()  // First, transform skipped steps to failed.
    )
    .run_and_exit("tests/features/readme")
    .await;

Implementors