Skip to content

Commit d64b85c

Browse files
committed
Upgrade outdated dependencies upon and yansi
1 parent 653241c commit d64b85c

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ once_cell = "1.12.0"
1616
pretty_assertions = "1.3.0"
1717
serde = { version = "1.0.136", features = ["derive"] }
1818
serde_json = "1.0.79"
19-
upon = "0.5.0"
20-
yansi = "0.5.1"
19+
upon = "0.8.1"
20+
yansi = "1.0.1"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ filename will be automatically determined based on the test file and test
2626
function name. Run tests with `GOLDIE_UPDATE=true` to automatically update
2727
golden files.
2828

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

47-
```rust
47+
```no_run
4848
#[test]
4949
fn example() {
5050
let text = { /* ... run the test ... */ };

src/lib.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//! function name. Run tests with `GOLDIE_UPDATE=true` to automatically update
1818
//! golden files.
1919
//!
20-
//! ```
20+
//! ```no_run
2121
//! #[test]
2222
//! fn example() {
2323
//! let text = { /* ... run the test ... */ };
@@ -35,7 +35,7 @@
3535
//! You cannot use `GOLDIE_UPDATE=true` to automatically update templated golden
3636
//! files.
3737
//!
38-
//! ```
38+
//! ```no_run
3939
//! #[test]
4040
//! fn example() {
4141
//! let text = { /* ... run the test ... */ };
@@ -219,7 +219,8 @@ impl Goldie {
219219
let expected = ENGINE
220220
.compile(&contents)
221221
.with_context(|| self.error("failed to compile golden file template"))?
222-
.render(&ctx)
222+
.render(&ENGINE, &ctx)
223+
.to_string()
223224
.with_context(|| self.error("failed to render golden file template"))?;
224225

225226
pretty_assertions::assert_eq!(
@@ -264,12 +265,12 @@ impl Goldie {
264265
}
265266

266267
fn error(&self, msg: &str) -> String {
267-
use yansi::Color;
268+
use yansi::Paint;
268269
format!(
269270
"\n\n{}: {}\nrun with {} to regenerate the golden file\n\n",
270-
Color::Red.paint(msg),
271+
msg.red(),
271272
self.golden_file.display(),
272-
Color::Blue.paint("GOLDIE_UPDATE=1").bold(),
273+
"GOLDIE_UPDATE=1".blue().bold(),
273274
)
274275
}
275276
}

0 commit comments

Comments
 (0)