(t *testing.T)
| 55 | } |
| 56 | |
| 57 | func Test_PrintSummary(t *testing.T) { |
| 58 | r := runtime.Result{ |
| 59 | Duration: 10, |
| 60 | Failed: 1, |
| 61 | TestResults: createFakeTestResults(), |
| 62 | } |
| 63 | |
| 64 | var buf bytes.Buffer |
| 65 | writer := NewCliOutput(true) |
| 66 | writer.out = &buf |
| 67 | |
| 68 | outResult := writer.PrintSummary(r) |
| 69 | assert.False(t, outResult) |
| 70 | |
| 71 | output := buf.String() |
| 72 | assert.Contains(t, output, "✗ [192.168.0.1] 'Failed test', on property 'Stdout'") |
| 73 | assert.NotContains(t, output, "✓ [docker-host] Successful test") |
| 74 | } |
| 75 | |
| 76 | func createFakeTestResults() []runtime.TestResult { |
| 77 | tr := runtime.TestResult{ |
nothing calls this directly
no test coverage detected