You've already forked goreleaser
							
							
				mirror of
				https://github.com/goreleaser/goreleaser.git
				synced 2025-10-30 23:58:09 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			532 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			532 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package valid
 | |
| 
 | |
| import (
 | |
| 	"testing"
 | |
| 
 | |
| 	"github.com/goreleaser/releaser/config"
 | |
| 	"github.com/goreleaser/releaser/context"
 | |
| 	"github.com/stretchr/testify/assert"
 | |
| )
 | |
| 
 | |
| func runPipe(repo, bin string) error {
 | |
| 	var config = &config.ProjectConfig{
 | |
| 		Repo:       repo,
 | |
| 		BinaryName: bin,
 | |
| 	}
 | |
| 	var ctx = &context.Context{
 | |
| 		Config: config,
 | |
| 	}
 | |
| 	return Pipe{}.Run(ctx)
 | |
| }
 | |
| 
 | |
| func TestValidadeMissingBinaryName(t *testing.T) {
 | |
| 	assert.Error(t, runPipe("a/b", ""))
 | |
| }
 | |
| 
 | |
| func TestValidadeMinimalConfig(t *testing.T) {
 | |
| 	assert.NoError(t, runPipe("", "a"))
 | |
| }
 |