NewWithClock is like New, but injects the given clock for tests that are time-dependent.
(t testing.TB, clk quartz.Clock, args ...string)
| 44 | // NewWithClock is like New, but injects the given clock for |
| 45 | // tests that are time-dependent. |
| 46 | func NewWithClock(t testing.TB, clk quartz.Clock, args ...string) (*serpent.Invocation, config.Root) { |
| 47 | var root cli.RootCmd |
| 48 | root.SetClock(clk) |
| 49 | |
| 50 | cmd, err := root.Command(root.AGPL()) |
| 51 | require.NoError(t, err) |
| 52 | |
| 53 | return NewWithCommand(t, cmd, args...) |
| 54 | } |
| 55 | |
| 56 | type logWriter struct { |
| 57 | prefix string |