github.com/axxelG/goreleaser@v0.92.0/pkg/build/build_test.go (about)

     1  package build
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/goreleaser/goreleaser/pkg/config"
     7  	"github.com/goreleaser/goreleaser/pkg/context"
     8  	"github.com/stretchr/testify/assert"
     9  )
    10  
    11  type dummy struct{}
    12  
    13  func (*dummy) WithDefaults(build config.Build) config.Build {
    14  	return build
    15  }
    16  func (*dummy) Build(ctx *context.Context, build config.Build, options Options) error {
    17  	return nil
    18  }
    19  
    20  func TestRegisterAndGet(t *testing.T) {
    21  	var builder = &dummy{}
    22  	Register("dummy", builder)
    23  	assert.Equal(t, builder, For("dummy"))
    24  }