Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/assert-rs/assert_fs
Filesystem fixtures and assertions.
https://github.com/assert-rs/assert_fs
Last synced: 2 months ago
JSON representation
Filesystem fixtures and assertions.
- Host: GitHub
- URL: https://github.com/assert-rs/assert_fs
- Owner: assert-rs
- License: apache-2.0
- Created: 2018-05-28T11:03:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-01T14:57:58.000Z (3 months ago)
- Last Synced: 2024-10-31T11:27:54.903Z (2 months ago)
- Language: Rust
- Homepage: docs.rs/assert_fs
- Size: 301 KB
- Stars: 96
- Watchers: 4
- Forks: 9
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# assert_fs
> **Assert Filesystems** - Filesystem fixtures and assertions for testing.
[![Documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation]
![License](https://img.shields.io/crates/l/assert_fs.svg)
[![Crates Status](https://img.shields.io/crates/v/assert_fs.svg)][Crates.io]`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:
```rust
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](https://docs.rs/assert_fs) for more information.
## License
Licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or )
* MIT license ([LICENSE-MIT](LICENSE-MIT) or )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.[Crates.io]: https://crates.io/crates/assert_fs
[Documentation]: https://docs.rs/assert_fs