Skip to content

Commit

Permalink
Merge branch 'master' into snapshot_kind
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty committed Dec 13, 2024
2 parents 21e7723 + f2783e5 commit 8271a6c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ env:
CARGO_TERM_COLOR: always
CLICOLOR_FORCE: 1
RUSTDOCFLAGS: "-Dwarnings"
RUSTFLAGS: "-D warnings"

jobs:
test-latest:
Expand Down
10 changes: 6 additions & 4 deletions cargo-insta/tests/functional/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ serde = { version = "1.0", features = ["derive"] }
r#"
use serde::Serialize;
#[allow(dead_code)]
#[derive(Serialize)]
struct User {
id: u64,
Expand Down Expand Up @@ -56,7 +57,7 @@ fn test_json_snapshot() {
assert_snapshot!(test_project.diff("src/lib.rs"), @r##"
--- Original: src/lib.rs
+++ Updated: src/lib.rs
@@ -15,5 +15,10 @@
@@ -16,5 +16,10 @@
};
insta::assert_json_snapshot!(&user, {
".id" => "[user_id]",
Expand Down Expand Up @@ -93,6 +94,7 @@ serde = { version = "1.0", features = ["derive"] }
r#"
use serde::Serialize;
#[allow(dead_code)]
#[derive(Serialize)]
struct User {
id: u64,
Expand Down Expand Up @@ -122,10 +124,10 @@ fn test_yaml_snapshot() {

assert!(&output.status.success());

assert_snapshot!(test_project.diff("src/lib.rs"), @r###"
assert_snapshot!(test_project.diff("src/lib.rs"), @r##"
--- Original: src/lib.rs
+++ Updated: src/lib.rs
@@ -15,5 +15,8 @@
@@ -16,5 +16,8 @@
};
insta::assert_yaml_snapshot!(&user, {
".id" => "[user_id]",
Expand All @@ -135,7 +137,7 @@ fn test_yaml_snapshot() {
+ email: [email protected]
+ "#);
}
"###);
"##);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion insta/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl TestRunner {
/// Fall back to `cargo test` if `cargo nextest` isn't installed and
/// `test_runner_fallback` is true
pub fn resolve_fallback(&self, test_runner_fallback: bool) -> &TestRunner {
use crate::_cargo_insta_support::get_cargo;
use crate::utils::get_cargo;
if self == &TestRunner::Nextest
&& test_runner_fallback
&& std::process::Command::new(get_cargo())
Expand Down

0 comments on commit 8271a6c

Please sign in to comment.