Skip to content

Commit

Permalink
chore: enhance test schema_is_up_to_date (#1285)
Browse files Browse the repository at this point in the history
Co-authored-by: Marco Ieni <11428655+MarcoIeni@users.noreply.github.com>
  • Loading branch information
isidzukuri and MarcoIeni authored Feb 21, 2024
1 parent 84b32a4 commit e50dc2b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
23 changes: 23 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ignore = "0.4.22"
lazy_static = "1.4.0"
once_cell = "1.19.0"
parse-changelog = { version = "0.6.4", default-features = false }
pretty_assertions = "1.4.0"
rayon = "1.8.1"
regex = "1.10.3"
reqwest = "0.11.24"
Expand Down
1 change: 1 addition & 0 deletions crates/release_plz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ assert_cmd.workspace = true
async-trait.workspace = true
fake.workspace = true
expect-test.workspace = true
pretty_assertions.workspace = true
serde_json.workspace = true
tempfile.workspace = true
toml_edit.workspace = true
4 changes: 3 additions & 1 deletion crates/release_plz/src/generate_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ fn generate_schema_json() -> anyhow::Result<String> {
#[cfg(test)]
mod tests {
use crate::generate_schema::{generate_schema_json, FILE, FOLDER};
use pretty_assertions::assert_eq;
use std::path::Path;
use std::{env, fs};

Expand Down Expand Up @@ -65,7 +66,8 @@ mod tests {
// Windows-friendly comparison
assert_eq!(
existing_json.replace("\r\n", "\n"),
new_json.replace("\r\n", "\n")
new_json.replace("\r\n", "\n"),
"(Hint: if change is intentional run `cargo run -- generate-schema` to update schema.)"
);
}
}

0 comments on commit e50dc2b

Please sign in to comment.