pub struct FileSystemContractSuite<'a> { /* private fields */ }Expand description
Runs synchronous provider contracts against one isolated fixture.
§Type Parameters
'a- Lifetime of the borrowed provider fixture.
§Examples
use qubit_fs_testkit::{FileSystemContract, FileSystemContractSuite};
let fixture = RustdocSyncFixture::new();
let mut suite = FileSystemContractSuite::new(&fixture);
suite.run_contract(FileSystemContract::Properties);
assert!(!suite.run().was_interrupted());Implementations§
Source§impl<'a> FileSystemContractSuite<'a>
impl<'a> FileSystemContractSuite<'a>
Sourcepub fn finish(&mut self)
pub fn finish(&mut self)
Cleans resources created by individually executed contract phases.
The first cleanup attempt closes resource preparation and all run
entry points, even when cleanup fails. Call finish again to retry
cleanup; create a fresh fixture and suite for another run.
§Panics
Panics when a recorded resource cannot be inspected or deleted.
Sourcepub fn capable(&self, capability: FileSystemCapability) -> bool
pub fn capable(&self, capability: FileSystemCapability) -> bool
Sourcepub fn required_seed(
&mut self,
relative: &str,
bytes: &[u8],
contract: &str,
) -> Path
pub fn required_seed( &mut self, relative: &str, bytes: &[u8], contract: &str, ) -> Path
Seeds a resource and makes support mandatory for the requested capability.
§Parameters
relative- Resource name relative to the current contract phase.bytes- Exact content to publish.contract- Contract label used in failure diagnostics.
§Returns
The provider path of the seeded file.
§Panics
Panics when cleanup has started, fixture setup fails, or the required seed hook is unsupported. A failed or interrupted cleanup attempt does not reopen resource preparation.
Sourcepub fn seed(&mut self, relative: &str, bytes: &[u8]) -> FixtureSupport<Path>
pub fn seed(&mut self, relative: &str, bytes: &[u8]) -> FixtureSupport<Path>
Delegates out-of-band resource preparation to the fixture.
§Parameters
relative- Resource name relative to the current contract phase.bytes- Exact content to publish.
§Returns
The fixture’s support result and seeded path, when available.
§Panics
Panics when cleanup has started or provider-specific fixture setup returns an error. A failed cleanup attempt does not reopen preparation.
Source§impl<'a> FileSystemContractSuite<'a>
impl<'a> FileSystemContractSuite<'a>
Sourcepub fn new(fixture: &'a dyn FileSystemFixture) -> Self
pub fn new(fixture: &'a dyn FileSystemFixture) -> Self
Sourcepub const fn run(&self) -> &ContractRun
pub const fn run(&self) -> &ContractRun
Returns the result retained by this suite, including a failed session.
Sourcepub fn report(&self) -> &ContractReport
pub fn report(&self) -> &ContractReport
Returns the report currently accumulated by this suite.
Sourcepub fn run_all(&mut self) -> &ContractRun
pub fn run_all(&mut self) -> &ContractRun
Executes all phases once and retains both execution and cleanup failures.
Returns a lifecycle failure without running checks if cleanup has already started. Use a fresh fixture and suite for another run.
§Returns
The retained execution result after the suite finishes.
Sourcepub fn run_contract(&mut self, contract: FileSystemContract) -> &ContractRun
pub fn run_contract(&mut self, contract: FileSystemContract) -> &ContractRun
Executes one phase once and retains its result in the suite.
Returns a lifecycle failure without running checks if cleanup has already started. Use a fresh fixture and suite for another run.
§Parameters
contract- Contract phase to execute.
§Returns
The retained execution result after the phase finishes.
Sourcepub fn run_check(&mut self, id: ContractCheckId) -> &ContractRun
pub fn run_check(&mut self, id: ContractCheckId) -> &ContractRun
Executes one selected check in a fresh session and retains its cleanup result.
Returns a lifecycle failure without running checks if cleanup has already started. Use a fresh fixture and suite for another run.
§Parameters
id- Check identity to execute.
§Returns
The retained execution result after the check finishes.