summaryrefslogtreecommitdiff
path: root/service/injector_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'service/injector_test.go')
-rw-r--r--service/injector_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/service/injector_test.go b/service/injector_test.go
new file mode 100644
index 00000000..eaf5fa72
--- /dev/null
+++ b/service/injector_test.go
@@ -0,0 +1,24 @@
+package service
+
+import (
+ "testing"
+ "github.com/stretchr/testify/assert"
+ "v/github.com/sirupsen/[email protected]/hooks/test"
+ "github.com/sirupsen/logrus"
+)
+
+func TestContainer_Init(t *testing.T) {
+ logger, hook := test.NewNullLogger()
+ logger.SetLevel(logrus.DebugLevel)
+
+ svc := &testService{ok: true}
+
+ c := NewContainer(logger)
+ c.Register("test", svc)
+ c.Register("test2", struct{}{})
+
+ assert.Equal(t, 2, len(hook.Entries))
+
+ assert.NoError(t, c.Serve())
+ c.Stop()
+} \ No newline at end of file