Remove node-namespace from Test Drivers/Adaptors

This commit is contained in:
Andrew Stewart 2014-05-06 18:56:13 -07:00
parent c8cb7f0e40
commit d46de63379
5 changed files with 36 additions and 86 deletions

View File

@ -8,30 +8,18 @@
"use strict";
var namespace = require('node-namespace');
var Adaptor = require('../adaptor');
module.exports = {
adaptor: function(opts) {
return new Cylon.Adaptors.Loopback(opts);
}
var Loopback;
module.exports = Loopback = function Loopback() {
Loopback.__super__.constructor.apply(this, arguments);
};
namespace("Cylon.Adaptors", function() {
this.Loopback = (function(klass) {
subclass(Loopback, klass);
subclass(Loopback, Adaptor);
function Loopback() {
var _ref = Loopback.__super__.constructor.apply(this, arguments);
return _ref;
}
Loopback.prototype.commands = function() {
return ['ping'];
};
Loopback.prototype.commands = function() {
return ['ping'];
};
return Loopback;
})(Adaptor);
});
Loopback.adaptor = function(opts) { return new Loopback(opts); };

View File

@ -8,34 +8,22 @@
'use strict';
var namespace = require('node-namespace');
var Driver = require('../driver');
module.exports = {
driver: function(opts) {
return new Cylon.Drivers.Ping(opts);
}
var Ping;
module.exports = Ping = function Ping() {
Ping.__super__.constructor.apply(this, arguments);
};
namespace("Cylon.Drivers", function() {
this.Ping = (function(klass) {
subclass(Ping, klass);
subclass(Ping, Driver);
function Ping() {
var _ref = Ping.__super__.constructor.apply(this, arguments);
return _ref;
}
Ping.prototype.commands = function() {
return ['ping'];
};
Ping.prototype.commands = function() {
return ['ping'];
};
Ping.prototype.ping = function() {
return "pong";
};
Ping.prototype.ping = function() {
return "pong";
};
return Ping;
})(Driver);
});
Ping.driver = function(opts) { return new Ping(opts); };

View File

@ -8,28 +8,14 @@
"use strict";
var namespace = require('node-namespace');
var Adaptor = require('../adaptor')
module.exports = {
adaptor: function(opts) {
return new Cylon.Adaptors.TestAdaptor(opts);
}
var TestAdaptor;
module.exports = TestAdaptor = function TestAdaptor() {
TestAdaptor.__super__.constructor.apply(this, arguments);
};
namespace("Cylon.Adaptors", function() {
this.TestAdaptor = (function(klass) {
subclass(TestAdaptor, klass);
subclass(TestAdaptor, Adaptor);
function TestAdaptor(opts) {
if (opts == null) {
opts = {};
}
TestAdaptor.__super__.constructor.apply(this, arguments);
}
return TestAdaptor;
})(Adaptor);
});
TestAdaptor.adaptor = function(opts) { return new TestAdaptor(opts); };

View File

@ -8,28 +8,14 @@
'use strict';
var namespace = require('node-namespace');
var Driver = require('../driver');
module.exports = {
driver: function(opts) {
return new Cylon.Drivers.TestDriver(opts);
}
var TestDriver;
module.exports = TestDriver = function TestDriver() {
TestDriver.__super__.constructor.apply(this, arguments);
};
namespace("Cylon.Drivers", function() {
this.TestDriver = (function(klass) {
subclass(TestDriver, klass);
subclass(TestDriver, Driver);
function TestDriver(opts) {
if (opts == null) {
opts = {};
}
TestDriver.__super__.constructor.apply(this, arguments);
}
return TestDriver;
})(Driver);
});
TestDriver.driver = function(opts) { return new TestDriver(opts); };

View File

@ -1,5 +1,7 @@
"use strict";
var Ping = source('test/ping');
source("device");
source("robot");
@ -11,7 +13,7 @@ describe("Cylon.Device", function() {
var connection = robot.connections.loopback;
var driver = new Cylon.Drivers.Ping({
var driver = new Ping({
name: 'driver',
device: { connection: connection, port: 13 }
})