newInitializedCeler returns a Celer that has been Init'd and has a freshly cloned conf repo — the minimum state required for configureCmd's checkIfInitialized() to pass. Every cmd.Execute()-style test needs this.
(t *testing.T)
| 41 | // cloned conf repo — the minimum state required for configureCmd's |
| 42 | // checkIfInitialized() to pass. Every cmd.Execute()-style test needs this. |
| 43 | func newInitializedCeler(t *testing.T) *configs.Celer { |
| 44 | t.Helper() |
| 45 | dirs.RemoveAllForTest() |
| 46 | |
| 47 | celer := configs.NewCeler() |
| 48 | if err := celer.Init(); err != nil { |
| 49 | t.Fatal(err) |
| 50 | } |
| 51 | if err := celer.CloneConf(test_conf_repo_url, test_conf_repo_branch, true); err != nil { |
| 52 | t.Fatal(err) |
| 53 | } |
| 54 | return celer |
| 55 | } |
| 56 | |
| 57 | // runCommand builds the cobra command from `command`, feeds it `args` just |
| 58 | // like a user would on the shell, captures everything the command writes to |
no test coverage detected