1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-03 13:11:48 +02:00

test: use ErrorIs

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos A Becker 2023-03-03 10:36:45 -03:00
parent 874d698564
commit 68cd12b506
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package cmd
import (
"os"
"testing"
"github.com/stretchr/testify/require"
@ -15,7 +16,7 @@ func TestCheckConfig(t *testing.T) {
func TestCheckConfigThatDoesNotExist(t *testing.T) {
cmd := newCheckCmd()
cmd.cmd.SetArgs([]string{"-f", "testdata/nope.yml"})
require.EqualError(t, cmd.cmd.Execute(), "open testdata/nope.yml: no such file or directory")
require.ErrorIs(t, cmd.cmd.Execute(), os.ErrNotExist)
}
func TestCheckConfigUnmarshalError(t *testing.T) {

View File

@ -1,6 +1,7 @@
package cmd
import (
"os"
"testing"
"github.com/stretchr/testify/require"
@ -15,7 +16,7 @@ func TestHealthcheckSystem(t *testing.T) {
func TestHealthcheckConfigThatDoesNotExist(t *testing.T) {
cmd := newHealthcheckCmd()
cmd.cmd.SetArgs([]string{"-f", "testdata/nope.yml"})
require.EqualError(t, cmd.cmd.Execute(), "open testdata/nope.yml: no such file or directory")
require.ErrorIs(t, cmd.cmd.Execute(), os.ErrNotExist)
}
func TestHealthcheckMissingTool(t *testing.T) {