From d550df34f886b6697cc9951f7e972f5164ed455a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Cordeiro?= Date: Tue, 26 Jul 2016 14:16:57 -0300 Subject: [PATCH] test-adaptor.js - Adding superclass methods Adding the connect and disconnect methods for the TestAdaptor can be used for tests otherwise an exception will be thrown. Exception: Adaptor#connect method must be overwritten by descendant classes. --- lib/test/test-adaptor.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/test/test-adaptor.js b/lib/test/test-adaptor.js index a70bf00..cf53c8c 100644 --- a/lib/test/test-adaptor.js +++ b/lib/test/test-adaptor.js @@ -9,5 +9,14 @@ var TestAdaptor = module.exports = function TestAdaptor() { Utils.subclass(TestAdaptor, Adaptor); + +TestAdaptor.prototype.connect = function(callback) { + callback(); +}; + +TestAdaptor.prototype.disconnect = function(callback) { + callback(); +}; + TestAdaptor.adaptors = ["test"]; TestAdaptor.adaptor = function(opts) { return new TestAdaptor(opts); };