1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-07-03 00:57:43 +02:00

test: improve file not found checkings (#3831)

using `errors.Is` everywhere, as file not found errors have different
messages on different OSes.
This commit is contained in:
Carlos Alexandro Becker
2023-03-04 12:16:26 -03:00
committed by GitHub
parent 29335c84a4
commit 82144cb2c0
10 changed files with 41 additions and 54 deletions

View File

@ -758,9 +758,9 @@ func TestRunPipeWithoutMainFunc(t *testing.T) {
t.Run("not main.go", func(t *testing.T) {
ctx := newCtx(t)
ctx.Config.Builds[0].Main = "foo.go"
require.EqualError(t, Default.Build(ctx, ctx.Config.Builds[0], api.Options{
require.ErrorIs(t, Default.Build(ctx, ctx.Config.Builds[0], api.Options{
Target: runtimeTarget,
}), `couldn't find main file: stat foo.go: no such file or directory`)
}), os.ErrNotExist)
})
t.Run("glob", func(t *testing.T) {
ctx := newCtx(t)