NewGoldenFile creates a new GoldenFile instance with default options
(t testing.TB, basePath string)
| 57 | |
| 58 | // NewGoldenFile creates a new GoldenFile instance with default options |
| 59 | func NewGoldenFile(t testing.TB, basePath string) *GoldenFile { |
| 60 | t.Helper() |
| 61 | return &GoldenFile{ |
| 62 | t: t, |
| 63 | basePath: func() string { |
| 64 | if basePath != "" { |
| 65 | return basePath |
| 66 | } |
| 67 | return DefaultBasePath |
| 68 | }(), |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | // Content sets the content to compare (fluent API) |
| 73 | func (g *GoldenFile) Content(content []byte) *GoldenFile { |
no outgoing calls