Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarkhas committed Jun 20, 2021
1 parent b09a7a0 commit d9b6a77
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ func TestHealthWithBogusCheck(t *testing.T) {
err := h.RegisterCheck(nil)
defer h.DeregisterAll()

assert.Error(t, err, "register bogus check should fail")
assert.Contains(t, err.Error(), "misconfigured check", "fail message")
assert.EqualError(t, err, "check must not be nil")
assert.True(t, h.IsHealthy(), "health after bogus register")

results, healthy := h.Results()
Expand All @@ -54,6 +53,7 @@ func TestHealthWithBogusCheck(t *testing.T) {

func TestRegisterCheckValidations(t *testing.T) {
h := New()
defer h.DeregisterAll()

// should return an error for nil check
assert.EqualError(t, h.RegisterCheck(nil), "check must not be nil")
Expand All @@ -63,6 +63,8 @@ func TestRegisterCheckValidations(t *testing.T) {
assert.EqualError(t, h.RegisterCheck(&checks.CustomCheck{CheckName: "non-empty"}), "execution period must be greater than 0")

hWithExecPeriod := New(ExecutionPeriod(1 * time.Minute))
defer hWithExecPeriod.DeregisterAll()

assert.NoError(t, hWithExecPeriod.RegisterCheck(&checks.CustomCheck{CheckName: "non-empty"}))

}
Expand Down

0 comments on commit d9b6a77

Please sign in to comment.