mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-10 03:47:03 +02:00
64b1f14a86
* refactor: merging archive in the same repo * refactor: merging archive in the same repo * refactor: better organizing packages * refactor: fixing renames * fix: new dep version * fix: makefile * fix: zip/tar tests * fix: gitigonore * fix: s3 tests * fix: archive test
25 lines
512 B
Go
25 lines
512 B
Go
package context
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/goreleaser/goreleaser/pkg/config"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestNew(t *testing.T) {
|
|
var ctx = New(config.Project{})
|
|
assert.NotEmpty(t, ctx.Env)
|
|
assert.Equal(t, 4, ctx.Parallelism)
|
|
}
|
|
|
|
func TestNewWithTimeout(t *testing.T) {
|
|
ctx, cancel := NewWithTimeout(config.Project{}, time.Second)
|
|
assert.NotEmpty(t, ctx.Env)
|
|
assert.Equal(t, 4, ctx.Parallelism)
|
|
cancel()
|
|
<-ctx.Done()
|
|
assert.EqualError(t, ctx.Err(), `context canceled`)
|
|
}
|