Debian Codegraph @

v2/errors_test.go

raw symbols SCIP
1 package goldie
2
3 import (
4 "testing"
5
6 "github.com/stretchr/testify/assert"
7 )
8
9 func TestErrFixtureNotFound(t *testing.T) {
10 expected := "Golden fixture not found. Try running with -update flag."
11 err := newErrFixtureNotFound()
12
13 assert.Equal(t, expected, err.Error())
14 assert.IsType(t, &errFixtureNotFound{}, err)
15 }
16
17 func TestErrFixtureMismatch(t *testing.T) {
18 message := "example message"
19 err := newErrFixtureMismatch(message)
20
21 assert.Equal(t, message, err.Error())
22 assert.IsType(t, &errFixtureMismatch{}, err)
23 }
24
25 func TestErrFixtureDirectoryIsFile(t *testing.T) {
26 message := "fixture folder is a file: some/location/thing"
27 location := "some/location/thing"
28 err := newErrFixtureDirectoryIsFile(location)
29
30 assert.Equal(t, message, err.Error())
31 assert.IsType(t, &errFixtureDirectoryIsFile{}, err)
32 }