Skip to content

Commit

Permalink
Merge pull request #122 from epage/snap
Browse files Browse the repository at this point in the history
chore: Upgrade to snapbox 0.6
  • Loading branch information
epage authored May 24, 2024
2 parents a6f3a12 + b8d0b9e commit 2385467
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 123 deletions.
89 changes: 17 additions & 72 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ criterion = "0.5.1"
difference = "2.0.0"
glob = "0.3.1"
serde = { version = "1.0.199", features = ["derive"] }
snapbox = { version = "0.5.9", features = ["diff", "harness", "path", "term-svg", "cmd", "examples"] }
snapbox = { version = "0.6.0", features = ["diff", "term-svg", "cmd", "examples"] }
toml = "0.5.11"
tryfn = "0.2.1"

[[bench]]
name = "simple"
Expand Down
2 changes: 1 addition & 1 deletion tests/examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ fn assert_example(target: &str, expected: snapbox::Data) {
.env("CLICOLOR_FORCE", "1")
.assert()
.success()
.stdout_eq(expected);
.stdout_eq(expected.raw());
}
9 changes: 4 additions & 5 deletions tests/fixtures/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ use std::error::Error;

fn main() {
#[cfg(not(windows))]
snapbox::harness::Harness::new("tests/fixtures/", setup, test)
tryfn::Harness::new("tests/fixtures/", setup, test)
.select(["*/*.toml"])
.action_env("SNAPSHOTS")
.test();
}

fn setup(input_path: std::path::PathBuf) -> snapbox::harness::Case {
fn setup(input_path: std::path::PathBuf) -> tryfn::Case {
let name = input_path.file_name().unwrap().to_str().unwrap().to_owned();
let expected = input_path.with_extension("svg");
snapbox::harness::Case {
let expected = tryfn::Data::read_from(&input_path.with_extension("svg"), None);
tryfn::Case {
name,
fixture: input_path,
expected,
Expand Down
Loading

0 comments on commit 2385467

Please sign in to comment.