File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -16,5 +16,5 @@ once_cell = "1.12.0"
16
16
pretty_assertions = " 1.3.0"
17
17
serde = { version = " 1.0.136" , features = [" derive" ] }
18
18
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"
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ filename will be automatically determined based on the test file and test
26
26
function name. Run tests with ` GOLDIE_UPDATE=true ` to automatically update
27
27
golden files.
28
28
29
- ``` rust
29
+ ``` no_run
30
30
#[test]
31
31
fn example() {
32
32
let text = { /* ... run the test ... */ };
@@ -44,7 +44,7 @@ order to render the template. Values are rendered using
44
44
You cannot use ` GOLDIE_UPDATE=true ` to automatically update templated golden
45
45
files.
46
46
47
- ``` rust
47
+ ``` no_run
48
48
#[test]
49
49
fn example() {
50
50
let text = { /* ... run the test ... */ };
Original file line number Diff line number Diff line change 17
17
//! function name. Run tests with `GOLDIE_UPDATE=true` to automatically update
18
18
//! golden files.
19
19
//!
20
- //! ```
20
+ //! ```no_run
21
21
//! #[test]
22
22
//! fn example() {
23
23
//! let text = { /* ... run the test ... */ };
35
35
//! You cannot use `GOLDIE_UPDATE=true` to automatically update templated golden
36
36
//! files.
37
37
//!
38
- //! ```
38
+ //! ```no_run
39
39
//! #[test]
40
40
//! fn example() {
41
41
//! let text = { /* ... run the test ... */ };
@@ -219,7 +219,8 @@ impl Goldie {
219
219
let expected = ENGINE
220
220
. compile ( & contents)
221
221
. with_context ( || self . error ( "failed to compile golden file template" ) ) ?
222
- . render ( & ctx)
222
+ . render ( & ENGINE , & ctx)
223
+ . to_string ( )
223
224
. with_context ( || self . error ( "failed to render golden file template" ) ) ?;
224
225
225
226
pretty_assertions:: assert_eq!(
@@ -264,12 +265,12 @@ impl Goldie {
264
265
}
265
266
266
267
fn error ( & self , msg : & str ) -> String {
267
- use yansi:: Color ;
268
+ use yansi:: Paint ;
268
269
format ! (
269
270
"\n \n {}: {}\n run with {} to regenerate the golden file\n \n " ,
270
- Color :: Red . paint ( msg ) ,
271
+ msg . red ( ) ,
271
272
self . golden_file. display( ) ,
272
- Color :: Blue . paint ( "GOLDIE_UPDATE=1" ) . bold( ) ,
273
+ "GOLDIE_UPDATE=1" . blue ( ) . bold( ) ,
273
274
)
274
275
}
275
276
}
You can’t perform that action at this time.
0 commit comments