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
impl Acceptance
Sourcepub fn load(dir: impl AsRef<Path>) -> Result<Self, String>
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.
Sourcepub fn load_for(dir: impl AsRef<Path>, platform: &str) -> Result<Self, String>
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.
Sourcepub fn tree(&self, dir: &Path) -> PathBuf
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>.
pub fn from_loaded(loaded: Loaded) -> Result<Self, String>
Sourcepub fn with_coverage(self) -> Self
pub fn with_coverage(self) -> Self
Add generated tests for the expectations no story exercises.
pub fn render_diagnostics(&self) -> String
pub fn run(&self, driver: &mut dyn Driver, opts: &RunOptions) -> Report
Sourcepub fn run_with(
&self,
driver: &mut dyn Driver,
opts: &RunOptions,
services: &mut Services,
) -> Report
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).
pub fn docs<'a>(&'a self, report: Option<&'a Report>) -> Docs<'a>
Sourcepub fn publish(
&self,
dir: &Path,
runner: &str,
report: &Report,
) -> Result<Report>
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.
Sourcepub fn assert_passes(
&self,
driver: &mut dyn Driver,
opts: &RunOptions,
) -> Report
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.