(t *testing.T)
| 138 | } |
| 139 | |
| 140 | func captureContextOutput(t *testing.T) (string, error) { |
| 141 | t.Helper() |
| 142 | |
| 143 | oldStdout := os.Stdout |
| 144 | r, w, _ := os.Pipe() |
| 145 | os.Stdout = w |
| 146 | |
| 147 | err := runContext(contextCmd, nil) |
| 148 | |
| 149 | w.Close() |
| 150 | os.Stdout = oldStdout |
| 151 | |
| 152 | var buf bytes.Buffer |
| 153 | buf.ReadFrom(r) |
| 154 | return buf.String(), err |
| 155 | } |
| 156 | |
| 157 | func TestContext_TouchesOnly(t *testing.T) { |
| 158 | tmpDir := createContextTestFiles(t) |
no test coverage detected