tmp-path

Crates.iotmp-path
lib.rstmp-path
version0.1.2
created_at2025-01-04 18:54:48.338436+00
updated_at2025-05-14 14:12:48.43479+00
descriptionTest helper to create a temporary directory
homepagehttps://github.com/sanders41/tmp-path
repositoryhttps://github.com/sanders41/tmp-path
max_upload_size
id1504172
size13,789
Paul Sanders (sanders41)

documentation

https://docs.rs/tmp-path

README

tmp-path

This create contains a macro intended for test purposes that creates a temporary directory named tmp_path as a Pathbuff.

Installation

Note that you also need to install the tempfile crate.

cargo add --dev tmp-path tempfile

Usage

use std::fs::File;

use tmp_path::tmp_path;

#[test]
#[tmp_path]
fn test_example() {
    let test_file = &tmp_path.join("test_file");
    File::create(&test_file).unwrap();

    assert!(test_file.is_file());
}
Commit count: 21

cargo fmt