1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-26 04:22:05 +02:00
goreleaser/internal/shell/shell_test.go

32 lines
687 B
Go
Raw Normal View History

package shell_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/goreleaser/goreleaser/internal/shell"
"github.com/goreleaser/goreleaser/pkg/config"
"github.com/goreleaser/goreleaser/pkg/context"
)
func TestRunAValidCommand(t *testing.T) {
assert := assert.New(t)
ctx := context.New(config.Project{})
err := shell.Run(ctx, "", []string{"echo", "test"}, []string{})
assert.NoError(err)
}
func TestRunAnInValidCommand(t *testing.T) {
assert := assert.New(t)
ctx := context.New(config.Project{})
err := shell.Run(ctx, "", []string{"invalid", "command"}, []string{})
assert.Error(err)
assert.Contains(err.Error(), "executable file not found")
}