RunCmdInDir runs a command in a given dir, expects no error and returns a result
(t testing.TB, dir string, args ...string)
| 339 | |
| 340 | // RunCmdInDir runs a command in a given dir, expects no error and returns a result |
| 341 | func (c *CLI) RunCmdInDir(t testing.TB, dir string, args ...string) *icmd.Result { |
| 342 | t.Helper() |
| 343 | t.Logf("\t[%s] %s\n", t.Name(), strings.Join(args, " ")) |
| 344 | assert.Assert(t, len(args) >= 1, "require at least one command in parameters") |
| 345 | cmd := c.NewCmd(args[0], args[1:]...) |
| 346 | cmd.Dir = dir |
| 347 | res := icmd.RunCmd(cmd) |
| 348 | res.Assert(t, icmd.Success) |
| 349 | return res |
| 350 | } |
| 351 | |
| 352 | // RunDockerCmd runs a docker command, expects no error and returns a result |
| 353 | func (c *CLI) RunDockerCmd(t testing.TB, args ...string) *icmd.Result { |