SayPath is used to assert that a path is printed within streaming output. On Windows, it uses a case-insensitive match and escapes the path.
(format string, path string)
| 12 | // SayPath is used to assert that a path is printed within streaming output. |
| 13 | // On Windows, it uses a case-insensitive match and escapes the path. |
| 14 | func SayPath(format string, path string) types.GomegaMatcher { |
| 15 | if runtime.GOOS == "windows" { |
| 16 | expected := "(?i)" + format |
| 17 | expected = fmt.Sprintf(expected, regexp.QuoteMeta(path)) |
| 18 | return gbytes.Say(expected) |
| 19 | } |
| 20 | return gbytes.Say(format, path) |
| 21 | } |