Crate assert_fs [] [src]

Filesystem fixtures and assertions for testing.

[dependencies]
assert_fs = "0.2"

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();
temp.child("foo.txt").touch().unwrap();
temp.child("foo.txt").assert(predicate::path::exists());
temp.child("bar.txt").assert(predicate::path::missing());
temp.close().unwrap();

Modules

prelude

Extension traits that are useful to have available.

Structs

ChildPath

A path within a TempDir

FixtureError

Failure when initializing the fixture.

TempDir

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

Traits

ChildPathTouchExt

Extend ChildPath to create empty files.

ChildPathWriteBinExt

Extend ChildPath to write binary files.

ChildPathWriteStrExt

Extend ChildPath to write text files.

TempDirAssertExt

Extend TempDir with assertions.

TempDirChildExt

Extend TempDir to perform operations on relative paths within the temp directory via ChildPath.

TempDirCopyExt

Extend TempDir to copy files into it.