Trait testpath::Fixtures[][src]

pub trait Fixtures: TestPath {
    fn create_file<P>(&self, name: P, content: &[u8]) -> &Self
    where
        P: AsRef<Path> + Sized,
        Self: Sized
, { ... }
fn create_dir<P>(&self, name: P) -> &Self
    where
        P: AsRef<Path> + Sized,
        Self: Sized
, { ... }
fn install_from<P>(&self, from: P) -> &Self
    where
        P: AsRef<Path> + Sized,
        Self: Sized
, { ... }
fn delete<N>(&self, _name: &N) -> &Self
    where
        N: AsRef<Path> + ?Sized
, { ... } }
Expand description

Trait for test directoy objects

Provided methods

Create a file with the given content in the test directory. Any leading directories are created automatically. The file itself must not already exist.

Create a directory within the test directory. Any leading directories are created automatically. The path must not exist already.

Install something (from outside) into ‘self’. ‘from’ must be some existing directory or a file, symlinks are resolved.

Following semantics apply when from is a file:

self isWhat is done
nonexistantself last component is the new filename, parent dirs are created
dirfrom is copied into self, but won’t overwrite an existing file
fileself gets overwritten

Following semantics apply when from is a directory:

self isWhat is done
nonexistantself including parents are created, the content of from is copied into that
dirthe content of from is copied into self
fileERROR

Delete an element from a testpath. Directories are deleted as well. This trait functions defaults to unimplemented because it is deemed to be dangerous. Only the trait implementations which create an disposable directory implement it.

Implementations on Foreign Types

Implementors