Crates.io | fixtures |
lib.rs | fixtures |
version | 0.1.0 |
source | src |
created_at | 2023-09-17 16:26:32.178834 |
updated_at | 2023-09-17 16:26:32.178834 |
description | Run tests against fixtures |
homepage | https://github.com/bcheidemann/fixtures-rs |
repository | https://github.com/bcheidemann/fixtures-rs |
max_upload_size | |
id | 975213 |
size | 6,019 |
fixtures
is a Rust crate which allows developers to run tests against fixture files.
#[cfg(test)]
mod tests {
use fixtures::fixtures;
#[fixtures("fixtures/*.txt")]
fn test(path: &std::path::Path) {
// This test will be run once for each file matching the glob pattern
}
}
The above example expands to:
#[cfg(test)]
mod tests {
use fixtures::fixtures;
fn test(path: &std::path::Path) {
// This test will be run once for each file matching the glob pattern
}
#[test]
fn test_one_dot_txt_1() {
test(::std::path::Path::new("fixtures/one.txt"));
}
#[test]
fn test_two_dot_txt_1() {
test(::std::path::Path::new("fixtures/two.txt"));
}
// ...
}