(t *testing.T)
| 209 | } |
| 210 | |
| 211 | func TestReportToString(t *testing.T) { |
| 212 | testCases := []reportToStringTestCase{ |
| 213 | { |
| 214 | name: "No items", |
| 215 | expectedString: fmt.Sprintf("\n%sNo problems found.\n%sRun `%s` if you want show pod logs\n\n", paddingLeft, paddingLeft, ansi.Color("devspace logs --pick", "white+b")), |
| 216 | }, |
| 217 | { |
| 218 | name: "testReport", |
| 219 | report: []*ReportItem{ |
| 220 | { |
| 221 | Name: "testReport", |
| 222 | Problems: []string{ |
| 223 | "Somethings wrong, I guess...", |
| 224 | }, |
| 225 | }, |
| 226 | }, |
| 227 | expectedString: ` |
| 228 | ` + ansi.Color(` ================================================================================ |
| 229 | testReport (1 potential issue(s)) |
| 230 | ================================================================================ |
| 231 | `, "green+b") + "Somethings wrong, I guess...\n", |
| 232 | }, |
| 233 | } |
| 234 | |
| 235 | for _, testCase := range testCases { |
| 236 | result := ReportToString(testCase.report) |
| 237 | assert.Equal(t, result, testCase.expectedString, "Unexpected result in testCase %s", testCase.name) |
| 238 | } |
| 239 | } |
nothing calls this directly
no test coverage detected