mirror of
https://github.com/goreleaser/goreleaser.git
synced 2024-12-31 01:53:50 +02:00
test: improve some tests
This commit is contained in:
parent
0fbc447fe1
commit
422c46daff
@ -1102,9 +1102,17 @@ func TestWrapInDirectory(t *testing.T) {
|
||||
func TestSkip(t *testing.T) {
|
||||
t.Run("skip", func(t *testing.T) {
|
||||
require.True(t, Pipe{}.Skip(testctx.New()))
|
||||
require.True(t, Pipe{}.Skip(testctx.New(testctx.Skip(skips.Scoop))))
|
||||
})
|
||||
|
||||
t.Run("skip flag", func(t *testing.T) {
|
||||
ctx := testctx.NewWithCfg(config.Project{
|
||||
Scoop: config.Scoop{
|
||||
Repository: config.RepoRef{
|
||||
Name: "a",
|
||||
},
|
||||
},
|
||||
}, testctx.Skip(skips.Scoop))
|
||||
require.False(t, Pipe{}.Skip(ctx))
|
||||
})
|
||||
t.Run("dont skip", func(t *testing.T) {
|
||||
ctx := testctx.NewWithCfg(config.Project{
|
||||
Scoop: config.Scoop{
|
||||
|
@ -679,9 +679,15 @@ func Test_isValidArch(t *testing.T) {
|
||||
func TestSkip(t *testing.T) {
|
||||
t.Run("skip", func(t *testing.T) {
|
||||
require.True(t, Pipe{}.Skip(testctx.New()))
|
||||
require.True(t, Pipe{}.Skip(testctx.New(testctx.Skip(skips.Snapcraft))))
|
||||
})
|
||||
|
||||
t.Run("skip flag", func(t *testing.T) {
|
||||
ctx := testctx.NewWithCfg(config.Project{
|
||||
Snapcrafts: []config.Snapcraft{
|
||||
{},
|
||||
},
|
||||
}, testctx.Skip(skips.Snapcraft))
|
||||
require.False(t, Pipe{}.Skip(ctx))
|
||||
})
|
||||
t.Run("dont skip", func(t *testing.T) {
|
||||
ctx := testctx.NewWithCfg(config.Project{
|
||||
Snapcrafts: []config.Snapcraft{
|
||||
|
@ -28,7 +28,11 @@ func TestString(t *testing.T) {
|
||||
func TestSkip(t *testing.T) {
|
||||
t.Run("should", func(t *testing.T) {
|
||||
require.True(t, Pipe{}.Skip(testctx.New()))
|
||||
require.True(t, Pipe{}.Skip(testctx.New(testctx.Skip(skips.Winget))))
|
||||
})
|
||||
t.Run("skip flag", func(t *testing.T) {
|
||||
require.False(t, Pipe{}.Skip(testctx.NewWithCfg(config.Project{
|
||||
Winget: []config.Winget{{}},
|
||||
}, testctx.Skip(skips.Winget))))
|
||||
})
|
||||
t.Run("should not", func(t *testing.T) {
|
||||
require.False(t, Pipe{}.Skip(testctx.NewWithCfg(config.Project{
|
||||
|
Loading…
Reference in New Issue
Block a user