Skip to content

Commit

Permalink
Upgrade outdated dependencies upon and yansi
Browse files Browse the repository at this point in the history
  • Loading branch information
rossmacarthur committed Apr 21, 2024
1 parent 653241c commit d64b85c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ once_cell = "1.12.0"
pretty_assertions = "1.3.0"
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.79"
upon = "0.5.0"
yansi = "0.5.1"
upon = "0.8.1"
yansi = "1.0.1"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ filename will be automatically determined based on the test file and test
function name. Run tests with `GOLDIE_UPDATE=true` to automatically update
golden files.

```rust
```no_run
#[test]
fn example() {
let text = { /* ... run the test ... */ };
Expand All @@ -44,7 +44,7 @@ order to render the template. Values are rendered using
You cannot use `GOLDIE_UPDATE=true` to automatically update templated golden
files.

```rust
```no_run
#[test]
fn example() {
let text = { /* ... run the test ... */ };
Expand Down
13 changes: 7 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! function name. Run tests with `GOLDIE_UPDATE=true` to automatically update
//! golden files.
//!
//! ```
//! ```no_run
//! #[test]
//! fn example() {
//! let text = { /* ... run the test ... */ };
Expand All @@ -35,7 +35,7 @@
//! You cannot use `GOLDIE_UPDATE=true` to automatically update templated golden
//! files.
//!
//! ```
//! ```no_run
//! #[test]
//! fn example() {
//! let text = { /* ... run the test ... */ };
Expand Down Expand Up @@ -219,7 +219,8 @@ impl Goldie {
let expected = ENGINE
.compile(&contents)
.with_context(|| self.error("failed to compile golden file template"))?
.render(&ctx)
.render(&ENGINE, &ctx)
.to_string()
.with_context(|| self.error("failed to render golden file template"))?;

pretty_assertions::assert_eq!(
Expand Down Expand Up @@ -264,12 +265,12 @@ impl Goldie {
}

fn error(&self, msg: &str) -> String {
use yansi::Color;
use yansi::Paint;
format!(
"\n\n{}: {}\nrun with {} to regenerate the golden file\n\n",
Color::Red.paint(msg),
msg.red(),
self.golden_file.display(),
Color::Blue.paint("GOLDIE_UPDATE=1").bold(),
"GOLDIE_UPDATE=1".blue().bold(),
)
}
}
Expand Down

0 comments on commit d64b85c

Please sign in to comment.