| Crates.io | assert-or-bless |
| lib.rs | assert-or-bless |
| version | 0.1.2 |
| created_at | 2025-08-05 18:50:21.16448+00 |
| updated_at | 2025-08-05 19:13:38.572355+00 |
| description | Assert that a multi-line string equals the contents of a blessable snapshot file. Print a nice colored diff if not. |
| homepage | https://github.com/Enselic/assert-or-bless |
| repository | https://github.com/Enselic/assert-or-bless |
| max_upload_size | |
| id | 1782515 |
| size | 10,558 |
This crate is ~30 lines of code. Audit with the following one-liner, but make sure you follow to the crates.io Data Access Policy:
curl -H "User-Agent: $USER at $HOST" \
-L https://crates.io/api/v1/crates/assert-or-bless/0.1.2/download |
tar --extract --gzip --to-stdout | less
Write a test:
#[test]
fn check_snapshot() {
let actual == "...";
assert_or_bless::assert_eq_or_bless(actual, "snapshot.txt");
}
Bless current output (write the snapshot file):
ASSERT_OR_BLESS=bless cargo test
Assert current output (compare with existing snapshot file):
cargo test