From 9116186b4c8550c934e6c76b920d9192396e88f0 Mon Sep 17 00:00:00 2001 From: Preetha Appan Date: Wed, 19 Jul 2017 11:00:56 -0500 Subject: [PATCH] Made unit test for AddCheck error check the actual error string --- agent/local_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/agent/local_test.go b/agent/local_test.go index 5e8d849f9..1808dba08 100644 --- a/agent/local_test.go +++ b/agent/local_test.go @@ -1547,8 +1547,9 @@ func TestAgent_AddCheckFailure(t *testing.T) { ServiceID: "redis", Status: api.HealthPassing, } - if err := l.AddCheck(chk, ""); err == nil { - t.Fatalf("Expected error when adding a check for a non-existent service") + expectedErr := "ServiceID \"redis\" does not exist" + if err := l.AddCheck(chk, ""); err == nil || expectedErr != err.Error() { + t.Fatalf("Expected error when adding a check for a non-existent service but got %v", err) } }