Skip to main content

Crate dev_fixtures

Crate dev_fixtures 

Source
Expand description

§dev-fixtures

Repeatable test environments, sample data, and controlled inputs for Rust. Part of the dev-* verification suite.

§Why

Tests are only useful if they are repeatable. AI agents in particular need fixtures that:

  • Build the same way every time
  • Clean themselves up
  • Provide both happy-path and adversarial inputs

dev-fixtures provides primitives for building those environments.

§Quick example

use dev_fixtures::TempProject;

let project = TempProject::new()
    .with_file("Cargo.toml", "[package]\nname = \"sample\"\n")
    .with_file("src/lib.rs", "pub fn answer() -> u32 { 42 }")
    .build()
    .unwrap();

// project.path() points at a temp directory.
// It is deleted automatically when `project` is dropped.

Structs§

TempProject
A temporary project directory that auto-cleans on drop.
TempProjectBuilder
Builder for TempProject.

Traits§

Fixture
A trait for any fixture that can be set up and torn down.