Attempt to stop drivers, then adaptors
This commit is contained in:
parent
8f20ccbcf3
commit
d2b00c7d30
|
@ -292,12 +292,16 @@ Robot.prototype.halt = function(callback) {
|
|||
fns.push(device.halt.bind(device));
|
||||
}
|
||||
|
||||
Async.parallel(fns, function() {
|
||||
var fns = [];
|
||||
|
||||
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) {
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue