github.com/triarius/goreleaser@v1.12.5/internal/pipe/custompublishers/custompublishers_test.go (about)

     1  package custompublishers
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/triarius/goreleaser/pkg/config"
     7  	"github.com/triarius/goreleaser/pkg/context"
     8  	"github.com/stretchr/testify/require"
     9  )
    10  
    11  func TestDescription(t *testing.T) {
    12  	require.NotEmpty(t, Pipe{}.String())
    13  }
    14  
    15  func TestSkip(t *testing.T) {
    16  	t.Run("skip", func(t *testing.T) {
    17  		require.True(t, Pipe{}.Skip(context.New(config.Project{})))
    18  	})
    19  
    20  	t.Run("dont skip", func(t *testing.T) {
    21  		ctx := context.New(config.Project{
    22  			Publishers: []config.Publisher{
    23  				{},
    24  			},
    25  		})
    26  		require.False(t, Pipe{}.Skip(ctx))
    27  	})
    28  }
    29  
    30  func TestPublish(t *testing.T) {
    31  	require.NoError(t, Pipe{}.Publish(context.New(config.Project{
    32  		Publishers: []config.Publisher{
    33  			{
    34  				Cmd: "echo",
    35  			},
    36  		},
    37  	})))
    38  }