purwa-testing 0.2.0

HTTP and optional Postgres test helpers for Purwa apps
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Environment helpers (no optional database dependencies).

/// Reads **`TEST_DATABASE_URL`** if set and non-empty (trimmed).
///
/// Use this for integration tests against a disposable Postgres instance (local or CI) without
/// Docker-based testcontainers. See workspace **README** / **TASK** Q4.
pub fn test_database_url_from_env() -> Option<String> {
    std::env::var("TEST_DATABASE_URL")
        .ok()
        .map(|s| s.trim().to_owned())
        .filter(|s| !s.is_empty())
}