Skip to content

Commit

Permalink
Add test variant for no-hook case
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwasila committed Jan 16, 2020
1 parent 623a3e9 commit 1e1c706
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions shutdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ func TestShutdowner(t *testing.T) {
atomic.AddInt32(&hookCounter, 1)
}

Convey("When no hook is registered and shutdown is called", func() {
s.callShutdownHooks()

Convey("Hook will not be called on shutdown", func() {
So(hookCounter, ShouldEqual, 1)
})
})

Convey("When hook is registered and shutdown is called", func() {
s.register(hook)
s.callShutdownHooks()
Expand Down

0 comments on commit 1e1c706

Please sign in to comment.