Add docs for tests modules: common, common::assert, common::test.

This is to better explain their purpose.
This commit is contained in:
Zeke Fast
2025-09-10 23:57:19 +02:00
committed by Vincent Breitmoser
parent 3bb755d8d9
commit 62a6248b29

View File

@@ -75,6 +75,9 @@ pub mod tests {
use rstest::rstest; use rstest::rstest;
use tempfile::TempDir; use tempfile::TempDir;
/// Contains reusable code which can be shared across different tests, like response assertions,
/// fixtures to set up the test environment and particular test implementations
/// which can be seeded with different values, but the implementation scheme remains the same.
pub mod common { pub mod common {
use crate::app::configure_rocket; use crate::app::configure_rocket;
use ::rocket::http::ContentType; use ::rocket::http::ContentType;
@@ -256,6 +259,7 @@ pub mod tests {
"token-pseudo-random" "token-pseudo-random"
} }
/// Contains reusable assertion helpers.
pub mod assert { pub mod assert {
use ::rocket::http::{ContentType, Status}; use ::rocket::http::{ContentType, Status};
use ::rocket::local::blocking::LocalResponse; use ::rocket::local::blocking::LocalResponse;
@@ -312,6 +316,7 @@ pub mod tests {
} }
} }
/// Contains reusable test implementations.
pub mod test { pub mod test {
use super::*; use super::*;
use ::rocket::http::{ContentType, Status}; use ::rocket::http::{ContentType, Status};