(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func TestRemoveCurrentForce(t *testing.T) { |
| 43 | configDir := t.TempDir() |
| 44 | configFilePath := filepath.Join(configDir, "config.json") |
| 45 | testCfg := configfile.New(configFilePath) |
| 46 | testCfg.CurrentContext = "current" |
| 47 | assert.NilError(t, testCfg.Save()) |
| 48 | |
| 49 | cli := makeFakeCli(t, withCliConfig(testCfg)) |
| 50 | createTestContexts(t, cli, "current", "other") |
| 51 | cli.SetCurrentContext("current") |
| 52 | assert.NilError(t, runRemove(cli, removeOptions{force: true}, []string{"current"})) |
| 53 | reloadedConfig, err := config.Load(configDir) |
| 54 | assert.NilError(t, err) |
| 55 | assert.Equal(t, "", reloadedConfig.CurrentContext) |
| 56 | } |
| 57 | |
| 58 | func TestRemoveDefault(t *testing.T) { |
| 59 | cli := makeFakeCli(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…