testpath

Crates.iotestpath
lib.rstestpath
version0.2.0
sourcesrc
created_at2021-07-13 13:18:36.983823
updated_at2021-12-07 18:20:39.120027
descriptioncompaninon crate to bintest/testcall, augments Paths for testing
homepage
repositoryhttps://github.com/cehteh/testpath.git
max_upload_size
id422268
size1,431,573
(cehteh)

documentation

README

Companinon crate to ‘bintest' and 'testcall’, implements facilities for running tests in directories.

Description

Allows creating of (temporary) test directories, optionally with a custom callback for cleanup. Populating these with content for testing and provide assertion to validate the content.

Example

#[test]
fn test_something() {
    let tmpdir = TempDir::new().expect("TempDir created");
    tmpdir.create_file("path/to/testfile", "Hello File!".as_bytes());
    tmpdir
        .sub_path("path/to/testfile")
        .assert_utf8("Hello File!");
}

Future Plans

New features will be added as needed, PR’s are welcome. This is work in progress.

Commit count: 13

cargo fmt