Skip to main content

Suite

Struct Suite 

Source
pub struct Suite {
    pub name: String,
    pub vocabulary: Vocabulary,
    pub background: Condition,
    pub background_steps: Vec<StepText>,
    pub sections: Vec<Section>,
    pub features: Vec<Feature>,
    pub expectations: Vec<Expectation>,
    pub stories: Vec<Story>,
    pub glossary: Vec<Term>,
    pub sources: Sources,
    pub platforms: Vec<String>,
    pub platform: Option<String>,
}
Expand description

A whole suite: the vocabulary, its sections (the first is the root), and the expectations and stories written against them.

Fields§

§name: String§vocabulary: Vocabulary§background: Condition

The root section’s start, which every section builds on.

§background_steps: Vec<StepText>§sections: Vec<Section>§features: Vec<Feature>§expectations: Vec<Expectation>§stories: Vec<Story>§glossary: Vec<Term>

Term:s: the glossary’s definitions.

§sources: Sources§platforms: Vec<String>

Platform:s the suite is run on; the first is the default, which untagged lines are about.

§platform: Option<String>

The platform this suite was read for (a lens on one platform’s variants), if the suite declares platforms.

Implementations§

Source§

impl Suite

Source

pub fn exp(&self, id: ExpId) -> &Expectation

Source

pub fn feature(&self, id: FeatureId) -> &Feature

Source

pub fn story(&self, id: StoryId) -> &Story

Source

pub fn section(&self, id: SectionId) -> &Section

Source

pub fn chain(&self, id: SectionId) -> Vec<&Section>

The root first, down to id.

Source

pub fn section_of(&self, e: ExpId) -> &Section

The section an expectation belongs to (its feature’s).

Source

pub fn subtree(&self, id: SectionId) -> Vec<SectionId>

id and every section below it.

Source

pub fn describe(&self, c: &Condition) -> String

Source

pub fn describe_trigger(&self, t: &Trigger) -> String

“the user presses reset”, “the dial is above 55 %”, or both.

Source

pub fn transitions(&self) -> impl Iterator<Item = &Expectation>

Transitions (expectations with a trigger), in declaration order.

Source

pub fn invariants(&self) -> impl Iterator<Item = &Expectation>

Trait Implementations§

Source§

impl Clone for Suite

Source§

fn clone(&self) -> Suite

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Suite

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Suite

Source§

fn default() -> Suite

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Suite

§

impl RefUnwindSafe for Suite

§

impl Send for Suite

§

impl Sync for Suite

§

impl Unpin for Suite

§

impl UnsafeUnpin for Suite

§

impl UnwindSafe for Suite

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.