2013-10-20 07:10:24 +08:00
|
|
|
'use strict';
|
|
|
|
|
2013-11-05 04:16:42 +08:00
|
|
|
source("device")
|
|
|
|
source("robot")
|
2013-10-24 14:02:54 +08:00
|
|
|
Driver = source("driver")
|
2013-10-20 07:10:24 +08:00
|
|
|
|
2013-10-23 13:21:37 +08:00
|
|
|
describe "Device", ->
|
2013-11-05 04:16:42 +08:00
|
|
|
robot = new Cylon.Robot(name: 'me')
|
2013-10-24 14:02:54 +08:00
|
|
|
driver = new Driver(name: 'driving')
|
|
|
|
requireDriver = sinon.stub(robot, 'requireDriver').returns(driver)
|
2013-11-05 04:16:42 +08:00
|
|
|
device = new Cylon.Device(name: "devisive", driver: 'driving', robot: robot)
|
2013-10-23 07:39:49 +08:00
|
|
|
|
|
|
|
it "should belong to a robot", ->
|
2013-10-23 13:06:49 +08:00
|
|
|
device.robot.name.should.be.equal 'me'
|
2013-10-20 07:10:24 +08:00
|
|
|
|
2013-10-21 13:30:01 +08:00
|
|
|
it "should have a name", ->
|
|
|
|
device.name.should.be.equal 'devisive'
|
2013-10-20 11:31:29 +08:00
|
|
|
|
2013-10-23 11:56:10 +08:00
|
|
|
it "should use default connection if none specified"
|
|
|
|
it "should use connection if one is specified"
|
2013-10-23 14:23:52 +08:00
|
|
|
|
|
|
|
it "should require a driver", ->
|
|
|
|
requireDriver.should.be.called
|