traefik-certs-dumper/hook/hook_test.go
2022-08-29 08:57:30 +02:00

32 lines
469 B
Go

package hook
import (
"context"
"testing"
)
func Test_execute(t *testing.T) {
testCases := []struct {
desc string
command string
}{
{
desc: "expand env vars",
command: `echo "${GOPATH} ${GOARCH}"`,
},
{
desc: "simple",
command: `echo 'hello'`,
},
}
for _, test := range testCases {
t.Run(test.desc, func(t *testing.T) {
err := execute(context.Background(), test.command)
if err != nil {
t.Fatal(err)
}
})
}
}