Extended test.

This commit is contained in:
Joern Barthel 2015-10-09 16:07:14 +02:00
parent be4b44b806
commit 0143a90f6e
1 changed files with 3 additions and 0 deletions

View File

@ -12,6 +12,8 @@ func TestAllHooks(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
logger, hook := NewNullLogger() logger, hook := NewNullLogger()
assert.Nil(hook.LastEntry())
assert.Equal(0, len(hook.Entries))
logger.Error("Hello error") logger.Error("Hello error")
assert.Equal(logrus.ErrorLevel, hook.LastEntry().Level) assert.Equal(logrus.ErrorLevel, hook.LastEntry().Level)
@ -24,6 +26,7 @@ func TestAllHooks(t *testing.T) {
assert.Equal(2, len(hook.Entries)) assert.Equal(2, len(hook.Entries))
hook.Reset() hook.Reset()
assert.Nil(hook.LastEntry())
assert.Equal(0, len(hook.Entries)) assert.Equal(0, len(hook.Entries))
hook = NewGlobal() hook = NewGlobal()