MCPcopy Create free account
hub / github.com/commander-cli/commander / Test_TestCommand_Http

Function Test_TestCommand_Http

pkg/app/test_command_test.go:101–118  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

99}
100
101func Test_TestCommand_Http(t *testing.T) {
102 defer gock.Off()
103
104 gock.New("http://foo.com").
105 Get("/bar").
106 Reply(200).
107 BodyString(`
108tests:
109 echo hello:
110 exit-code: 0
111`)
112
113 out := captureOutput(func() {
114 TestCommand("http://foo.com/bar", TestCommandContext{Verbose: true})
115 })
116
117 assert.Contains(t, out, "✓ [local] echo hello")
118}
119
120func Test_TestCommand_Http_Err(t *testing.T) {
121 err := TestCommand("http://error/not/a/url", TestCommandContext{Dir: false})

Callers

nothing calls this directly

Calls 2

captureOutputFunction · 0.85
TestCommandFunction · 0.85

Tested by

no test coverage detected