(t *testing.T)
| 203 | } |
| 204 | |
| 205 | func TestCreateDefaultNameAutoDiscover(t *testing.T) { |
| 206 | line := &lib.Line{ |
| 207 | CommandToRun: "cronitor d3x0c1 cronitor discover --auto /discover/test", |
| 208 | LineNumber: 11, |
| 209 | RunAs: "", |
| 210 | } |
| 211 | crontab := &lib.Crontab{ |
| 212 | Filename: "/discover/test", |
| 213 | } |
| 214 | |
| 215 | defaultName := createDefaultName(line, crontab, "localhost", nil, map[string]bool{}) |
| 216 | |
| 217 | expected := "[localhost] Auto discover /discover/test" |
| 218 | if defaultName != expected { |
| 219 | t.Errorf("Auto discover test failed, got: %s, expected: %s.", defaultName, expected) |
| 220 | } |
| 221 | } |
nothing calls this directly
no test coverage detected