diff --git a/lib/device.js b/lib/device.js index ba1472a..b25ab64 100644 --- a/lib/device.js +++ b/lib/device.js @@ -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 }; }; diff --git a/test/specs/device.spec.js b/test/specs/device.spec.js index 38dea10..d042346 100644 --- a/test/specs/device.spec.js +++ b/test/specs/device.spec.js @@ -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() {