Skip to main content

Acceptance

Struct Acceptance 

Source
pub struct Acceptance {
    pub suite: Suite,
    pub analysis: Analysis,
    pub plans: Vec<Plan>,
    pub diagnostics: Vec<Diagnostic>,
    pub dir: Option<PathBuf>,
    pub platform: Option<String>,
}
Expand description

A suite that has been checked and planned, ready to run.

Fields§

§suite: Suite§analysis: Analysis§plans: Vec<Plan>§diagnostics: Vec<Diagnostic>

Warnings (and notes) from checking it; errors stop it loading.

§dir: Option<PathBuf>

The directory it was loaded from, if it was.

§platform: Option<String>

Set by Acceptance::load_for: the platform this is the suite of. Its results are its own, and its docs are one tree of several (see Acceptance::tree).

Implementations§

Source§

impl Acceptance

Source

pub fn load(dir: impl AsRef<Path>) -> Result<Self, String>

Load, check and plan the suite in dir. Anything that’s an error — a step outside the vocabulary, an unsettled conflict, a story relying on unspecified behaviour — fails it, with every diagnostic rendered.

Source

pub fn load_for(dir: impl AsRef<Path>, platform: &str) -> Result<Self, String>

As Acceptance::load, for one platform of a suite that declares several: the variants written for it replace the plain lines, and what is On: elsewhere is left out. Run the same suite on each platform with its own driver.

Source

pub fn tree(&self, dir: &Path) -> PathBuf

Where this platform’s docs go under the docs directory dir: the default platform’s (and a suite without platforms) are in dir itself, the others’ in dir/platforms/<name>.

Source

pub fn from_loaded(loaded: Loaded) -> Result<Self, String>

Source

pub fn with_coverage(self) -> Self

Add generated tests for the expectations no story exercises.

Source

pub fn render_diagnostics(&self) -> String

Source

pub fn run(&self, driver: &mut dyn Driver, opts: &RunOptions) -> Report

Source

pub fn run_with( &self, driver: &mut dyn Driver, opts: &RunOptions, services: &mut Services, ) -> Report

As Acceptance::run, with what the driver needs from outside started first (see service).

Source

pub fn docs<'a>(&'a self, report: Option<&'a Report>) -> Docs<'a>

Source

pub fn publish( &self, dir: &Path, runner: &str, report: &Report, ) -> Result<Report>

Save report as runner’s results in dir/results/ (a platform’s runner saves its own: app@iOS.tsv), merge them with the results that apply to this platform, and write its docs (Markdown and the HTML site) from the lot. Returns the merged report.

Source

pub fn assert_passes( &self, driver: &mut dyn Driver, opts: &RunOptions, ) -> Report

Run every plan, write the docs to opts.docs_dir (if set) whatever happened, and panic with what failed. For #[test]s.

Auto Trait Implementations§

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> 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, 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.