Attempt to stop drivers, then adaptors

This commit is contained in:
Andrew Stewart 2014-09-04 10:18:18 -07:00
parent 8f20ccbcf3
commit d2b00c7d30
2 changed files with 12 additions and 7 deletions

View File

@ -292,12 +292,16 @@ Robot.prototype.halt = function(callback) {
fns.push(device.halt.bind(device));
}
for (var c in this.connections) {
var connection = this.connections[c];
fns.push(connection.disconnect.bind(connection));
}
Async.parallel(fns, function() {
var fns = [];
Async.parallel(fns, callback);
for (var c in this.connections) {
var connection = this.connections[c];
fns.push(connection.disconnect.bind(connection));
}
Async.parallel(fns, callback);
}.bind(this));
};
// Public: Initialize an adaptor and adds it to @robot.adaptors
@ -323,6 +327,7 @@ Robot.prototype.initAdaptor = function(adaptorName, connection, opts) {
connection: connection,
extraParams: opts
});
return Utils.proxyTestStubs(adaptor.commands, testAdaptor);
for (var prop in adaptor) {

View File

@ -348,8 +348,8 @@ describe("Robot", function() {
device = bot.devices.ping;
connection = bot.connections.loopback;
stub(device, 'halt').returns(true);
stub(connection, 'disconnect').returns(true);
stub(device, 'halt').yields(true);
stub(connection, 'disconnect').yields(true);
});
afterEach(function() {