mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-10 03:47:03 +02:00
962429de06
the publish pipe, which runs all publishers, already skips all publishers if skip publish is set, so this check is not needed here. Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
39 lines
745 B
Go
39 lines
745 B
Go
package custompublishers
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/testctx"
|
|
"github.com/goreleaser/goreleaser/pkg/config"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestDescription(t *testing.T) {
|
|
require.NotEmpty(t, Pipe{}.String())
|
|
}
|
|
|
|
func TestSkip(t *testing.T) {
|
|
t.Run("skip", func(t *testing.T) {
|
|
require.True(t, Pipe{}.Skip(testctx.New()))
|
|
})
|
|
|
|
t.Run("dont skip", func(t *testing.T) {
|
|
ctx := testctx.NewWithCfg(config.Project{
|
|
Publishers: []config.Publisher{
|
|
{},
|
|
},
|
|
})
|
|
require.False(t, Pipe{}.Skip(ctx))
|
|
})
|
|
}
|
|
|
|
func TestPublish(t *testing.T) {
|
|
require.NoError(t, Pipe{}.Publish(testctx.NewWithCfg(config.Project{
|
|
Publishers: []config.Publisher{
|
|
{
|
|
Cmd: "echo",
|
|
},
|
|
},
|
|
})))
|
|
}
|