(t *testing.T)
| 99 | } |
| 100 | |
| 101 | func 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(` |
| 108 | tests: |
| 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 | |
| 120 | func Test_TestCommand_Http_Err(t *testing.T) { |
| 121 | err := TestCommand("http://error/not/a/url", TestCommandContext{Dir: false}) |
nothing calls this directly
no test coverage detected