Crate assert_fs[][src]

Filesystem fixtures and assertions for testing.

Fixtures:

For assertions, see PathAssert.

[dependencies]
assert_fs = "0.9"

Example

Here is a trivial example:

This example is not tested
use assert_fs::prelude::*;
use predicates::prelude::*;

let temp = assert_fs::TempDir::new().unwrap();
let input_file = temp.child("foo.txt");
input_file.touch().unwrap();

// ... do something with input_file ...

input_file.assert("");
temp.child("bar.txt").assert(predicate::path::missing());

temp.close().unwrap();

Re-exports

pub use assert::PathAssert;

Modules

assert

Filesystem assertions.

errors

Error types for fixtures.

prelude

Extension traits that are useful to have available.

Structs

ChildPath

A path within a TempDir

TempDir

A directory in the filesystem that is automatically deleted when it goes out of scope.

Traits

FileTouch

Create empty files at ChildPath.

FileWriteBin

Write a binary file at ChildPath.

FileWriteStr

Write a text file at ChildPath.

PathChild

Access paths within TempDir for testing.

PathCopy

Copy files into TempDir.