pub struct Feature { /* private fields */ }Expand description
Declare what a file’s scenarios are for, ahead of the examples.
Scenarios say what the system does. A declaration says why the feature exists and who it serves, so a reader meets the intent before the examples.
Reach for declare_feature! rather than calling this directly: Rust has
no portable way to run code before a test binary’s tests, so the macro
wraps the declaration in a #[test] of its own.
use executable_stories::Feature;
Feature::new("Anyone can do arithmetic without a calculator app")
.ability()
.narrative("Switching apps for a quick sum loses your place.")
.term("operand", "One of the two numbers an operation is applied to.")
.declare(file!());Implementations§
Source§impl Feature
impl Feature
Sourcepub fn business_need(self) -> Self
pub fn business_need(self) -> Self
Frame the feature as a cross-cutting concern nobody asks for by name, such as security or performance.
Sourcepub fn narrative(self, narrative: &str) -> Self
pub fn narrative(self, narrative: &str) -> Self
Explain, in markdown, why the feature exists and who it serves.
Apply tags to every scenario in the file.
Auto Trait Implementations§
impl Freeze for Feature
impl RefUnwindSafe for Feature
impl Send for Feature
impl Sync for Feature
impl Unpin for Feature
impl UnsafeUnpin for Feature
impl UnwindSafe for Feature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more