cylon/test/dist/specs/connection.spec.js

38 lines
1012 B
JavaScript
Raw Normal View History

2013-10-25 05:25:42 +08:00
(function() {
'use strict';
2013-11-05 04:13:40 +08:00
source("connection");
2013-10-25 05:25:42 +08:00
2013-11-12 00:28:37 +08:00
source("test/adaptor");
2013-10-25 05:25:42 +08:00
2013-11-12 00:28:37 +08:00
source("robot");
2013-10-25 05:25:42 +08:00
describe("Connection", function() {
var adaptor, connection, initAdaptor, robot;
2013-11-12 00:28:37 +08:00
robot = new Cylon.Robot({
2013-10-25 05:25:42 +08:00
name: 'me'
});
2013-11-12 00:28:37 +08:00
adaptor = new Cylon.Adaptor({
2013-10-25 05:25:42 +08:00
name: 'loopback'
});
initAdaptor = sinon.stub(robot, 'initAdaptor').returns(adaptor);
2013-11-05 04:13:40 +08:00
connection = new Cylon.Connection({
2013-10-25 05:25:42 +08:00
name: "connective",
adaptor: "loopback",
robot: robot
});
it("should belong to a robot", function() {
return connection.robot.name.should.be.equal('me');
});
it("should have a name", function() {
return connection.name.should.be.equal('connective');
});
it("should have an adaptor", function() {
return connection.adaptor.name.should.be.equal('loopback');
});
it("should be able to require an external adaptor module");
it("should be able to connect");
2013-10-29 02:58:31 +08:00
return it("should be able to disconnect");
2013-10-25 05:25:42 +08:00
});
}).call(this);