1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-20 03:59:26 +02:00
goreleaser/internal/ids/ids_test.go
Carlos Alexandro Becker 8286402e3e
fix: better duplicate ID message
refs #1090

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-07-27 10:55:56 -03:00

23 lines
407 B
Go

package ids
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestIDs(t *testing.T) {
var ids = New("foos")
ids.Inc("foo")
ids.Inc("bar")
require.NoError(t, ids.Validate())
}
func TestIDsError(t *testing.T) {
var ids = New("builds")
ids.Inc("foo")
ids.Inc("bar")
ids.Inc("foo")
require.EqualError(t, ids.Validate(), "found 2 builds with the ID 'foo', please fix your config")
}