1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/internal/ids/ids_test.go

23 lines
407 B
Go
Raw Normal View History

2019-05-07 12:18:35 +02:00
package ids
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestIDs(t *testing.T) {
var ids = New("foos")
2019-05-07 12:18:35 +02:00
ids.Inc("foo")
ids.Inc("bar")
require.NoError(t, ids.Validate())
}
func TestIDsError(t *testing.T) {
var ids = New("builds")
2019-05-07 12:18:35 +02:00
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")
2019-05-07 12:18:35 +02:00
}