From a88fe526f4c374c73ed09c410d623894007357fd Mon Sep 17 00:00:00 2001 From: Andrew Stewart Date: Mon, 3 Mar 2014 12:24:29 -0800 Subject: [PATCH] Add tests for Connection#data --- test/specs/connection.spec.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/specs/connection.spec.js b/test/specs/connection.spec.js index 05c3b05..c1bc41b 100644 --- a/test/specs/connection.spec.js +++ b/test/specs/connection.spec.js @@ -53,4 +53,28 @@ describe("Connection", function() { connection.disconnect(); adaptorDisconnect.should.be.called; }); + + describe("#data", function() { + var data = connection.data(); + + it("returns an object", function() { + expect(data).to.be.a('object'); + }); + + it("contains the connection's name", function() { + expect(data.name).to.be.eql(connection.name); + }); + + it("contains the connection's port", function() { + expect(data.port).to.be.eql(connection.port.toString()); + }); + + it("contains the connection's adaptor name", function() { + expect(data.adaptor).to.be.eql(connection.adaptor.constructor.name); + }); + + it("contains the connection's ID", function() { + expect(data.connection_id).to.be.eql(connection.connection_id); + }); + }); });