Refer to device connections by name in JSON format
This commit is contained in:
parent
b4a68d1a37
commit
ace5f15a36
|
@ -78,7 +78,7 @@ Device.prototype.toJSON = function() {
|
|||
name: this.name,
|
||||
driver: this.driver.constructor.name || this.driver.name,
|
||||
pin: this.pin,
|
||||
connection: this.connection.toJSON(),
|
||||
connection: this.connection.name,
|
||||
commands: this.driver.commands
|
||||
};
|
||||
};
|
||||
|
|
|
@ -41,7 +41,7 @@ describe("Device", function() {
|
|||
expect(device.pin).to.be.eql(13);
|
||||
});
|
||||
|
||||
it("sets @connection to the specified connection on the Robot", function() {
|
||||
it("sets @connection to the name of the specified connection on the Robot", function() {
|
||||
expect(device.connection).to.be.eql(connection);
|
||||
});
|
||||
|
||||
|
@ -125,8 +125,8 @@ describe("Device", function() {
|
|||
expect(json.driver).to.be.eql('Ping');
|
||||
});
|
||||
|
||||
it("contains the device's connection json", function() {
|
||||
expect(json.connection).to.be.eql(device.connection.toJSON());
|
||||
it("contains the device's connection name", function() {
|
||||
expect(json.connection).to.be.eql('loopback');
|
||||
});
|
||||
|
||||
it("contains the device's driver commands", function() {
|
||||
|
|
Loading…
Reference in New Issue