Trait cucumber::writer::NonTransforming
source · [−]pub trait NonTransforming { }
Expand description
Marker indicating that a Writer
doesn’t transform or rearrange events.
It’s used to ensure that a Writer
s pipeline is built in the right order,
avoiding situations like an event transformation isn’t done before it’s
Repeat
ed.
Example
If you want to pipeline FailOnSkipped
, Summarize
and Repeat
Writer
s, the code won’t compile because of the wrong pipelining order.
ⓘ
MyWorld::cucumber()
.with_writer(
// `Writer`s pipeline is constructed in a reversed order.
writer::Basic::stdout()
.fail_on_skipped() // Fails as `Repeat` will re-output skipped
.repeat_failed() // steps instead of failed ones.
.summarized()
)
.run_and_exit("tests/features/readme")
.await;
ⓘ
MyWorld::cucumber()
.with_writer(
// `Writer`s pipeline is constructed in a reversed order.
writer::Basic::stdout()
.repeat_failed()
.fail_on_skipped() // Fails as `Summarize` will count skipped
.summarized() // steps instead of `failed` ones.
)
.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.
.repeat_failed() // Then, repeat failed ones once again.
.summarized() // Only then, count summary for them.
.fail_on_skipped(), // First, transform skipped steps to failed.
)
.run_and_exit("tests/features/readme")
.await;