2018-01-21 14:31:08 -02:00
|
|
|
package build
|
|
|
|
|
2018-01-23 00:22:00 -02:00
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2018-08-14 23:50:20 -03:00
|
|
|
"github.com/goreleaser/goreleaser/pkg/config"
|
|
|
|
"github.com/goreleaser/goreleaser/pkg/context"
|
2018-01-23 00:22:00 -02:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
type dummy struct{}
|
|
|
|
|
2018-01-26 19:35:12 -02:00
|
|
|
func (*dummy) WithDefaults(build config.Build) config.Build {
|
2018-01-23 00:22:00 -02:00
|
|
|
return build
|
|
|
|
}
|
|
|
|
func (*dummy) Build(ctx *context.Context, build config.Build, options Options) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestRegisterAndGet(t *testing.T) {
|
|
|
|
var builder = &dummy{}
|
|
|
|
Register("dummy", builder)
|
|
|
|
assert.Equal(t, builder, For("dummy"))
|
|
|
|
}
|