1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-08 03:31:59 +02:00
goreleaser/pipeline/piper_test.go
Carlos Alexandro Becker 1ed299a6d7 refactor: defaulter interface
Right now the code looks weird because the defaults
of a pipe are far away of the implementation of the pipe.

the intend of this PR is to bring them closer by having a
Defaulter interface.

I also renamed the Pipe interface to Piper, and removed
the Description method in favor for fmt.Stringer.
2017-12-03 13:00:01 -02:00

21 lines
363 B
Go

package pipeline
import (
"errors"
"testing"
"github.com/stretchr/testify/assert"
)
func TestSkipPipe(t *testing.T) {
var reason = "this is a test"
var err = Skip(reason)
assert.Error(t, err)
assert.Equal(t, reason, err.Error())
}
func TestIsSkip(t *testing.T) {
assert.True(t, IsSkip(Skip("whatever")))
assert.False(t, IsSkip(errors.New("nope")))
}