Struct goldenfile::mint::Mint [] [src]

pub struct Mint { /* fields omitted */ }

A Mint creates goldenfiles.

When a Mint goes out of scope, it will do one of two things depending on the value of the REGENERATE_GOLDENFILES environment variable:

  1. If REGENERATE_GOLDENFILES!=1, it will check the new goldenfile contents against their old contents, and panic if they differ.
  2. If REGENERATE_GOLDENFILES=1, it will replace the old goldenfile contents with the newly written contents.

Methods

impl Mint
[src]

Create a new goldenfile Mint.

All goldenfiles will be created in the Mint's directory.

Create a new goldenfile.

The returned file is actually a temporary file, not the goldenfile itself. When the Mint goes out of scope, it will either check the temp file against the real goldenfile, or replace the real goldenfile based on the value of the REGENERATE_GOLDENFILES environment variable.

Check new goldenfile contents against old, and panic if they differ.

This is called automatically when a Mint goes out of scope and REGENERATE_GOLDENFILES!=1.

Overwrite old goldenfile contents with their new contents.

This is called automatically when a Mint goes out of scope and REGENERATE_GOLDENFILES=1.

Trait Implementations

impl Drop for Mint
[src]

A method called when the value goes out of scope. Read more