New creates a CLI instance with a configuration pointed to a temporary testing directory. The invocation is set up to use a global config directory for the given testing.TB, and keyring usage disabled.
(t testing.TB, args ...string)
| 33 | // global config directory for the given testing.TB, and keyring |
| 34 | // usage disabled. |
| 35 | func New(t testing.TB, args ...string) (*serpent.Invocation, config.Root) { |
| 36 | var root cli.RootCmd |
| 37 | |
| 38 | cmd, err := root.Command(root.AGPL()) |
| 39 | require.NoError(t, err) |
| 40 | |
| 41 | return NewWithCommand(t, cmd, args...) |
| 42 | } |
| 43 | |
| 44 | // NewWithClock is like New, but injects the given clock for |
| 45 | // tests that are time-dependent. |