Commit 8278bff3 authored by Victor Lopez's avatar Victor Lopez

Merge branch 'pc/improve-only-test' into 'master'

Improve the only test to reduce cyclomatic complexity (less indentation)

See merge request gl-infra/oncall-robot-assistant!3
parents 9a59154b 93d537d1
......@@ -7,11 +7,13 @@ import (
func TestReadConfig(t *testing.T) {
filename := "invalid-cfg.json"
_, err := readConfig(filename)
if err != nil {
want := "stat invalid-cfg.json: no such file or directory"
got := err.Error()
if got != want {
t.Errorf("readConfig(\"%s\"): expected '%s', got '%s'\n", filename, want, got)
}
if err == nil {
t.Fatalf("could not read configuration file %s", filename)
}
want := "stat invalid-cfg.json: no such file or directory"
got := err.Error()
if got != want {
t.Fatalf("wrong configuration error, got %s; expected %s", got, want)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment