1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00

test: fixed tests

broken because of dist not being removed anymore
This commit is contained in:
Carlos Alexandro Becker 2017-12-10 11:36:39 -02:00 committed by Carlos Alexandro Becker
parent f3fcb48983
commit 07c04b33f8
3 changed files with 7 additions and 4 deletions

View File

@ -40,8 +40,8 @@ func init() {
var pipes = []pipeline.Piper{
defaults.Pipe{}, // load default configs
dist.Pipe{}, // ensure ./dist is clean
effectiveconfig.Pipe{}, // writes the actual config (with defaults et al set) to dist
git.Pipe{}, // get and validate git repo state
effectiveconfig.Pipe{}, // writes the actual config (with defaults et al set) to dist
changelog.Pipe{}, // builds the release changelog
env.Pipe{}, // load and validate environment variables
build.Pipe{}, // build

View File

@ -49,5 +49,5 @@ func (Pipe) Run(ctx *context.Context) (err error) {
}
func mkdir(ctx *context.Context) error {
return os.Mkdir(ctx.Config.Dist, 0755)
return os.MkdirAll(ctx.Config.Dist, 0755)
}

View File

@ -12,12 +12,15 @@ import (
)
func TestDistDoesNotExist(t *testing.T) {
folder, err := ioutil.TempDir("", "disttest")
assert.NoError(t, err)
var dist = filepath.Join(folder, "dist")
assert.NoError(
t,
Pipe{}.Run(
&context.Context{
Config: config.Project{
Dist: "/wtf-this-shouldnt-exist",
Dist: dist,
},
},
),
@ -55,7 +58,7 @@ func TestEmptyDistExists(t *testing.T) {
}
assert.NoError(t, Pipe{}.Run(ctx))
_, err = os.Stat(dist)
assert.False(t, os.IsExist(err))
assert.False(t, os.IsNotExist(err))
}
func TestDescription(t *testing.T) {