Skip to main content

declare_feature

Macro declare_feature 

Source
macro_rules! declare_feature {
    ($feature:expr $(,)?) => { ... };
}
Expand description

Declare a feature for the current test file.

Rust runs nothing before a test binary’s tests, so the declaration goes in a #[test] of its own. Put this at module scope, once per file:

use executable_stories::{declare_feature, Feature};

declare_feature!(
    Feature::new("Anyone can do arithmetic without a calculator app")
        .ability()
        .narrative("Switching apps for a quick sum loses your place.")
);

Filtering tests (cargo test add) skips the generated test along with everything else it excludes, so that run’s report carries no narrative.