1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/internal/pipe/custompublishers/custompublishers_test.go
Carlos Alexandro Becker 962429de06
fix(custom_publishers): skip publish is check by publish pipe (#4274)
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>
2023-09-04 16:21:11 -03:00

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