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

Function TestSubmitWithoutWorkspace

cmd/submit_test.go:35–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestSubmitWithoutWorkspace(t *testing.T) {
36 v := viper.New()
37 v.Set("token", "abc123")
38
39 cfg := config.Config{
40 Persister: config.InMemoryPersister{},
41 UserViperConfig: v,
42 DefaultBaseURL: "http://example.com",
43 }
44
45 err := runSubmit(cfg, pflag.NewFlagSet("fake", pflag.PanicOnError), []string{})
46 if assert.Error(t, err) {
47 assert.Regexp(t, "re-run the configure", err.Error())
48 }
49}
50
51func TestSubmitNonExistentFile(t *testing.T) {
52 tmpDir, err := os.MkdirTemp("", "submit-no-such-file")

Callers

nothing calls this directly

Calls 2

runSubmitFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected