forked from sebdah/goldie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors_test.go
32 lines (24 loc) · 803 Bytes
/
errors_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package goldie
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestErrFixtureNotFound(t *testing.T) {
expected := "Golden fixture not found. Try running with -update flag."
err := newErrFixtureNotFound()
assert.Equal(t, expected, err.Error())
assert.IsType(t, errFixtureNotFound{}, err)
}
func TestErrFixtureMismatch(t *testing.T) {
message := "example message"
err := newErrFixtureMismatch(message)
assert.Equal(t, message, err.Error())
assert.IsType(t, errFixtureMismatch{}, err)
}
func TestErrFixtureDirectoryIsFile(t *testing.T) {
message := "fixture folder is a file: some/location/thing"
location := "some/location/thing"
err := newErrFixtureDirectoryIsFile(location)
assert.Equal(t, message, err.Error())
assert.IsType(t, errFixtureDirectoryIsFile{}, err)
}