Skip to content
Snippets Groups Projects
Commit a20f70cf authored by ensiouel's avatar ensiouel
Browse files

refactor test

parent 7149ed62
Branches
Tags
No related merge requests found
......@@ -16,13 +16,7 @@ func TestExample(t *testing.T) {
service.On("Log", mock.Anything, mock.Anything).
Return(nil).Once()
func() {
ws := NewBufferedWriteSyncer(service)
defer func() {
err := ws.Stop()
assert.NoError(t, err)
}()
logger := WithLogService(zap.NewNop(), ws)
logger.Info("создан элемент коллекции",
......@@ -41,7 +35,9 @@ func TestExample(t *testing.T) {
Object("/spaces/WPNN/envs/9VGP/cols/GxNv/items/W0fl/revs/cmV2cw"),
CallerFromContext(ContextWithCaller(context.Background(), "/users/PHVz")),
)
}()
err := ws.Stop()
assert.NoError(t, err)
service.AssertCalled(t, "Log", mock.Anything, mock.MatchedBy(func(entries []*log.Entry) bool {
return len(entries) == 2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment