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.
This commit is contained in:
André Cordeiro 2016-07-26 14:16:57 -03:00 committed by GitHub
parent ac1bd1ef3f
commit d550df34f8
1 changed files with 9 additions and 0 deletions

View File

@ -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); };