1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00
goreleaser/internal/deprecate/deprecate_test.go
Carlos Alexandro Becker 0694b46bcc
fix: better deprecation notices (#561)
* fix: better deprecation notices

* test: covered deprecate with tests

* docs: improved docs

* docs: improved docs

* chore: organize imports

* style: code improve
2018-02-17 13:43:29 -02:00

25 lines
615 B
Go

package deprecate
import (
"bytes"
"testing"
"github.com/stretchr/testify/assert"
"github.com/apex/log"
"github.com/apex/log/handlers/cli"
)
func TestNotice(t *testing.T) {
var out bytes.Buffer
cli.Default.Writer = &out
log.SetHandler(cli.Default)
log.Info("first")
Notice("foo.bar.whatever")
log.Info("last")
assert.Contains(t, out.String(), " • first")
assert.Contains(t, out.String(), " • DEPRECATED: `foo.bar.whatever` should not be used anymore, check https://goreleaser.com/#deprecation_notices.foo_bar_whatever for more info.")
assert.Contains(t, out.String(), " • last")
}