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:
parent
874d698564
commit
68cd12b506
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user