cylon/test/src/specs/device.spec.coffee

24 lines
652 B
CoffeeScript
Raw Normal View History

2013-10-20 07:10:24 +08:00
'use strict';
2013-11-05 04:16:42 +08:00
source("device")
source("robot")
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')
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)
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"
it "should require a driver", ->
requireDriver.should.be.called