Skip to content

Commit 2385467

Browse files
authored
Merge pull request #122 from epage/snap
chore: Upgrade to snapbox 0.6
2 parents a6f3a12 + b8d0b9e commit 2385467

File tree

5 files changed

+68
-123
lines changed

5 files changed

+68
-123
lines changed

Cargo.lock

+17-72
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ criterion = "0.5.1"
3333
difference = "2.0.0"
3434
glob = "0.3.1"
3535
serde = { version = "1.0.199", features = ["derive"] }
36-
snapbox = { version = "0.5.9", features = ["diff", "harness", "path", "term-svg", "cmd", "examples"] }
36+
snapbox = { version = "0.6.0", features = ["diff", "term-svg", "cmd", "examples"] }
3737
toml = "0.5.11"
38+
tryfn = "0.2.1"
3839

3940
[[bench]]
4041
name = "simple"

tests/examples.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ fn assert_example(target: &str, expected: snapbox::Data) {
3333
.env("CLICOLOR_FORCE", "1")
3434
.assert()
3535
.success()
36-
.stdout_eq(expected);
36+
.stdout_eq(expected.raw());
3737
}

tests/fixtures/main.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@ use std::error::Error;
88

99
fn main() {
1010
#[cfg(not(windows))]
11-
snapbox::harness::Harness::new("tests/fixtures/", setup, test)
11+
tryfn::Harness::new("tests/fixtures/", setup, test)
1212
.select(["*/*.toml"])
13-
.action_env("SNAPSHOTS")
1413
.test();
1514
}
1615

17-
fn setup(input_path: std::path::PathBuf) -> snapbox::harness::Case {
16+
fn setup(input_path: std::path::PathBuf) -> tryfn::Case {
1817
let name = input_path.file_name().unwrap().to_str().unwrap().to_owned();
19-
let expected = input_path.with_extension("svg");
20-
snapbox::harness::Case {
18+
let expected = tryfn::Data::read_from(&input_path.with_extension("svg"), None);
19+
tryfn::Case {
2120
name,
2221
fixture: input_path,
2322
expected,

0 commit comments

Comments
 (0)