MCPcopy Index your code
hub / github.com/assert-rs/assert_fs

github.com/assert-rs/assert_fs @v1.1.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1.4 ↗ · + Follow
93 symbols 192 edges 11 files 31 documented · 33%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

assert_fs

Assert Filesystems - Filesystem fixtures and assertions for testing.

Documentation License Crates Status

assert_fs aims to simplify - Setting up files for your tests to consume - Asserting on files produced by your tests

Example

Here is a trivial example:

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();

See the documentation for more information.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

Extension points exported contracts — how you extend this code

IntoPathPredicate (Interface)
Used by [`PathAssert`] to convert Self into the needed [`predicates_core::Predicate `]. # Examples ```rust use st [6 implementers]
src/assert.rs
FileTouch (Interface)
Create empty files at [`ChildPath`]. [2 implementers]
src/fixture/tools.rs
PathAssert (Interface)
Assert the state of files within [`TempDir`]. This uses [`IntoPathPredicate`] to provide short-hands for common cases, [3 …
src/assert.rs
FileWriteBin (Interface)
Write a binary file at [`ChildPath`]. [2 implementers]
src/fixture/tools.rs
FileWriteStr (Interface)
Write a text file at [`ChildPath`]. [2 implementers]
src/fixture/tools.rs
FileWriteFile (Interface)
Write (copy) a file to [`ChildPath`]. [2 implementers]
src/fixture/tools.rs
PathCopy (Interface)
Copy files into [`TempDir`]. [2 implementers]
src/fixture/tools.rs

Core symbols most depended-on inside this repo

chain
called by 24
src/fixture/errors.rs
path
called by 22
src/fixture/dir.rs
as_ref
called by 8
src/fixture/dir.rs
assert
called by 4
src/assert.rs
into_path
called by 4
src/assert.rs
find_case
called by 4
src/assert.rs
ensure_parent_dir
called by 4
src/fixture/tools.rs
create_dir_all
called by 4
src/fixture/tools.rs

Shape

Method 50
Function 17
Interface 13
Class 10
Enum 3

Languages

Rust100%

Modules by API surface

src/fixture/tools.rs25 symbols
src/assert.rs18 symbols
src/fixture/dir.rs12 symbols
src/fixture/errors.rs10 symbols
src/fixture/file.rs9 symbols
src/color.rs8 symbols
src/fixture/child.rs7 symbols
tests/assert.rs2 symbols
src/lib.rs1 symbols
examples/failure.rs1 symbols

For agents

$ claude mcp add assert_fs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact