pub struct Scenario { /* private fields */ }
Expand description

The embodiment of a subplot scenario

Scenario objects are built up by the generated test functions and then run to completion. In rare cases they may be built up and cached for reuse for example if a scenario is a subroutine.

Scenarios are built from steps in sequence, and then can be run.


let mut scenario = Scenario::new("example scenario");

let run_step = subplotlib::steplibrary::runcmd::run::Builder::default()
    .argv0("true")
    .args("")
    .build("when I run true".to_string());
scenario.add_step(run_step, None);

Implementations

Create a new scenario with the given title

Retrieve the scenario title

Add a scenario step, with optional cleanup step function.

Register a type with the scenario contexts

Run the scenario to completion.

Running the scenario to completion requires running each step in turn. This will return the first encountered error, or unit if the scenario runs cleanly.

Panics

If any of the cleanup functions error, this will immediately panic.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.