mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-22 04:08:49 +02:00
f9b693edf0
* add hooks for universal binaries * task fmt
32 lines
687 B
Go
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")
|
|
}
|