Skip to main content

Crate gize_testing

Crate gize_testing 

Source
Expand description

Test utilities for Gize-generated applications (WS-B5).

Two small, dependency-free helpers make it practical to test a generated app end-to-end: EphemeralSqlite gives a throwaway SQLite database (no server needed — ideal for CI), and App spawns a compiled app binary against it and waits until it is accepting connections. Both clean up on Drop. Bring your own HTTP client for the assertions.

use gize_testing::{App, EphemeralSqlite};

let db = EphemeralSqlite::new();
let app = App::spawn("target/debug/blog", &db)?;
// app.base_url() is now serving; make requests, assert, then drop to shut down.

Structs§

App
A spawned generated app. Killed when dropped.
EphemeralSqlite
A throwaway SQLite database file, removed when dropped. Serverless — perfect for CI.

Functions§

free_port
Pick a free TCP port by binding to :0 and reading back the assigned port.