MCPcopy Create free account
hub / github.com/exercism/cli / TestBareConfigure

Function TestBareConfigure

cmd/configure_test.go:19–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17)
18
19func 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
39func TestConfigureShow(t *testing.T) {
40 co := newCapturedOutput()

Callers

nothing calls this directly

Calls 3

setupConfigureFlagsFunction · 0.85
runConfigureFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected