You've already forked goreleaser
mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-06-23 00:40:06 +02:00
test: fixed hooks tests
refs #2875
refs f585f3be69
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
@ -274,14 +274,14 @@ func TestRun(t *testing.T) {
|
||||
ctx := ctx5
|
||||
ctx.Config.UniversalBinaries[0].Hooks.Pre = []config.Hook{{Cmd: "exit 1"}}
|
||||
ctx.Config.UniversalBinaries[0].Hooks.Post = []config.Hook{{Cmd: "echo post"}}
|
||||
require.EqualError(t, Pipe{}.Run(ctx), `pre hook failed: "": exec: "exit": executable file not found in $PATH`)
|
||||
require.EqualError(t, Pipe{}.Run(ctx), "pre hook failed: failed to run 'exit 1': exec: \"exit\": executable file not found in $PATH")
|
||||
})
|
||||
|
||||
t.Run("failing post-hook", func(t *testing.T) {
|
||||
ctx := ctx5
|
||||
ctx.Config.UniversalBinaries[0].Hooks.Pre = []config.Hook{{Cmd: "echo pre"}}
|
||||
ctx.Config.UniversalBinaries[0].Hooks.Post = []config.Hook{{Cmd: "exit 1"}}
|
||||
require.EqualError(t, Pipe{}.Run(ctx), `post hook failed: "": exec: "exit": executable file not found in $PATH`)
|
||||
require.EqualError(t, Pipe{}.Run(ctx), "post hook failed: failed to run 'exit 1': exec: \"exit\": executable file not found in $PATH")
|
||||
})
|
||||
|
||||
t.Run("hook with env tmpl", func(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user