mirror of
https://github.com/goreleaser/goreleaser.git
synced 2024-12-31 01:53:50 +02:00
68cd12b506
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
33 lines
851 B
Go
33 lines
851 B
Go
package cmd
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestHealthcheckSystem(t *testing.T) {
|
|
cmd := newHealthcheckCmd()
|
|
cmd.cmd.SetArgs([]string{"-f", "testdata/good.yml"})
|
|
require.NoError(t, cmd.cmd.Execute())
|
|
}
|
|
|
|
func TestHealthcheckConfigThatDoesNotExist(t *testing.T) {
|
|
cmd := newHealthcheckCmd()
|
|
cmd.cmd.SetArgs([]string{"-f", "testdata/nope.yml"})
|
|
require.ErrorIs(t, cmd.cmd.Execute(), os.ErrNotExist)
|
|
}
|
|
|
|
func TestHealthcheckMissingTool(t *testing.T) {
|
|
cmd := newHealthcheckCmd()
|
|
cmd.cmd.SetArgs([]string{"-f", "testdata/missing_tool.yml"})
|
|
require.EqualError(t, cmd.cmd.Execute(), "one or more needed tools are not present")
|
|
}
|
|
|
|
func TestHealthcheckQuier(t *testing.T) {
|
|
cmd := newHealthcheckCmd()
|
|
cmd.cmd.SetArgs([]string{"-f", "testdata/good.yml", "--quiet"})
|
|
require.NoError(t, cmd.cmd.Execute())
|
|
}
|