1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-22 04:08:49 +02:00
goreleaser/internal/shell/shell_test.go
Weslei Juan Novaes Pereira f9b693edf0
feat: add hooks to universal binaries (#2684)
* add hooks for universal binaries

* task fmt
2021-11-23 15:53:12 -03:00

32 lines
687 B
Go

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")
}