From 1b549f2dbbe4fe5b4de01908031ee9bd53ff5278 Mon Sep 17 00:00:00 2001 From: Andrew Stewart Date: Mon, 22 Sep 2014 09:53:10 -0700 Subject: [PATCH] Remove Adaptor#_noop function --- lib/adaptor.js | 10 ---------- test/specs/adaptor.spec.js | 18 ------------------ 2 files changed, 28 deletions(-) diff --git a/lib/adaptor.js b/lib/adaptor.js index 39dceb5..3257807 100644 --- a/lib/adaptor.js +++ b/lib/adaptor.js @@ -29,13 +29,3 @@ var Adaptor = module.exports = function Adaptor(opts) { Utils.subclass(Adaptor, Basestar); Adaptor.prototype.commands = []; - -// Public: Voids all command functions so they do not interact -// with anything after disconnect has been called. -// -// Returns nothing -Adaptor.prototype._noop = function() { - this.commands.forEach(function(command) { - this[command] = function() {}; - }.bind(this)); -}; diff --git a/test/specs/adaptor.spec.js b/test/specs/adaptor.spec.js index bd9d178..1ef73da 100644 --- a/test/specs/adaptor.spec.js +++ b/test/specs/adaptor.spec.js @@ -23,22 +23,4 @@ describe("Adaptor", function() { expect(adaptor.commands).to.be.eql([]); }); }); - - describe("#_noop", function() { - var hello; - - beforeEach(function() { - adaptor.commands = ["hello"]; - hello = adaptor.hello = spy(); - }); - - it("sets all adaptor commands to no-op functions", function() { - expect(adaptor.hello).to.be.eql(hello); - - adaptor._noop(); - - adaptor.hello(); - expect(hello).to.not.be.called; - }); - }); });