(t *testing.T)
| 17 | ) |
| 18 | |
| 19 | func TestBareConfigure(t *testing.T) { |
| 20 | flags := pflag.NewFlagSet("fake", pflag.PanicOnError) |
| 21 | setupConfigureFlags(flags) |
| 22 | |
| 23 | v := viper.New() |
| 24 | err := flags.Parse([]string{}) |
| 25 | assert.NoError(t, err) |
| 26 | |
| 27 | cfg := config.Config{ |
| 28 | Persister: config.InMemoryPersister{}, |
| 29 | UserViperConfig: v, |
| 30 | DefaultBaseURL: "http://example.com", |
| 31 | } |
| 32 | |
| 33 | err = runConfigure(cfg, flags) |
| 34 | if assert.Error(t, err) { |
| 35 | assert.Regexp(t, "no token configured", err.Error()) |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | func TestConfigureShow(t *testing.T) { |
| 40 | co := newCapturedOutput() |
nothing calls this directly
no test coverage detected