File: errors_test.go

package info (click to toggle)
golang-github-sebdah-goldie 2.5.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 200 kB
  • sloc: makefile: 2
file content (32 lines) | stat: -rw-r--r-- 806 bytes parent folder | download | duplicates (2)
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)
}