           expect(result.logs[0].message).to.be.equal "#{identifier} #{logs[0]}"
           expect(result.logs[1].message).to.be.equal "#{identifier} #{logs[1]}"
 
-          KodingLogger.close()
-
           done()
 
-      for log in logs
-        KodingLogger[scope] group, log
+      , 4000
+
+
+  describe '# close', ->
+
+    it 'should close existing connection from papertrail', (done) ->
+
+      expect(KodingLogger.logger).to.exist
+      expect(KodingLogger.pt).to.exist
+
+      KodingLogger.close()
+
+      expect(KodingLogger.logger).to.not.exist
+      expect(KodingLogger.pt).to.not.exist
+
+      done()
 
 
 runTests()


      identifier = KodingLogger.getIdentifier scope, group

      KodingLogger.connect()

      KodingLogger.pt.on 'connect', ->

        KodingLogger.search { query }, (err, result) ->


          expect(result.logs).to.have.length.above 0
          expect(result.logs[0].message).to.be.equal "#{identifier} #{log}"

          done()

      , 2000


  describe '# search', ->
