mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
added more archive pipe test
This commit is contained in:
parent
2919edc13f
commit
26727a6f7f
@ -47,10 +47,10 @@ func create(ctx *context.Context, platform, name string) error {
|
||||
var folder = filepath.Join(ctx.Config.Dist, name)
|
||||
var format = formatFor(ctx, platform)
|
||||
file, err := os.Create(folder + "." + format)
|
||||
log.Println("Creating", file.Name())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Println("Creating", file.Name())
|
||||
defer func() { _ = file.Close() }()
|
||||
var archive = archiveFor(file, format)
|
||||
defer func() { _ = archive.Close() }()
|
||||
|
@ -64,6 +64,23 @@ func TestRunPipe(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestRunPipeDistRemoved(t *testing.T) {
|
||||
var assert = assert.New(t)
|
||||
var ctx = &context.Context{
|
||||
Archives: map[string]string{
|
||||
"darwinamd64": "mybin",
|
||||
"windowsamd64": "mybin",
|
||||
},
|
||||
Config: config.Project{
|
||||
Dist: "/path/nope",
|
||||
Archive: config.Archive{
|
||||
Format: "zip",
|
||||
},
|
||||
},
|
||||
}
|
||||
assert.Error(Pipe{}.Run(ctx))
|
||||
}
|
||||
|
||||
func TestFormatFor(t *testing.T) {
|
||||
var assert = assert.New(t)
|
||||
var ctx = &context.Context{
|
||||
|
@ -12,7 +12,6 @@ import (
|
||||
func remoteRepo() (result config.Repo, err error) {
|
||||
cmd := exec.Command("git", "config", "--get", "remote.origin.url")
|
||||
bts, err := cmd.CombinedOutput()
|
||||
// TODO: cover this with tests
|
||||
if err != nil {
|
||||
return result, errors.New(err.Error() + ": " + string(bts))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user