(t *testing.T, args []string)
| 61 | } |
| 62 | |
| 63 | func captureRmOutput(t *testing.T, args []string) (string, error) { |
| 64 | t.Helper() |
| 65 | |
| 66 | oldStdout := os.Stdout |
| 67 | r, w, _ := os.Pipe() |
| 68 | os.Stdout = w |
| 69 | |
| 70 | err := runRm(rmCmd, args) |
| 71 | |
| 72 | w.Close() |
| 73 | os.Stdout = oldStdout |
| 74 | |
| 75 | var buf bytes.Buffer |
| 76 | buf.ReadFrom(r) |
| 77 | return buf.String(), err |
| 78 | } |
| 79 | |
| 80 | func TestRm_WithForce(t *testing.T) { |
| 81 | tmpDir := createRmTestFiles(t) |
no test coverage detected