errors_test.go
raw| 1 | package gitobj |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/stretchr/testify/assert" |
| 7 | ) |
| 8 | |
| 9 | func TestUnexpectedObjectTypeErrFormatting(t *testing.T) { |
| 10 | err := &UnexpectedObjectType{ |
| 11 | Got: TreeObjectType, Wanted: BlobObjectType, |
| 12 | } |
| 13 | |
| 14 | assert.Equal(t, "gitobj: unexpected object type, got: \"tree\", wanted: \"blob\"", err.Error()) |
| 15 | } |