TestConfigFailure asserts that an error is returned if the config file cannot be read.
(t *testing.T)
| 336 | // TestConfigFailure asserts that an error is returned if the config file |
| 337 | // cannot be read. |
| 338 | func TestConfigFailure(t *testing.T) { |
| 339 | |
| 340 | // attempt to read a non-existent config file |
| 341 | _, err := New("/does-not-exit", false) |
| 342 | if err == nil { |
| 343 | t.Errorf("failed to error on unreadable config") |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | // TestEditorEnvOverride asserts that $VISUAL and $EDITOR override the |
| 348 | // config file value at runtime (regression test for #589) |