Name is just an option

This commit is contained in:
deadprogram 2013-10-19 18:32:59 -07:00
parent 7cbf27e636
commit b0f4d9f12b
10 changed files with 19 additions and 14 deletions

View File

@ -9,4 +9,5 @@
'use strict'; 'use strict';
module.exports = class Adaptor module.exports = class Adaptor
constructor: (@name) -> constructor: (opts) ->
@name = opts.name

View File

@ -9,4 +9,5 @@
'use strict'; 'use strict';
module.exports = class Connection module.exports = class Connection
constructor: (@name) -> constructor: (opts) ->
@name = opts.name

View File

@ -9,4 +9,5 @@
'use strict'; 'use strict';
module.exports = class Device module.exports = class Device
constructor: (@name) -> constructor: (opts) ->
@name = opts.name

View File

@ -9,4 +9,5 @@
'use strict'; 'use strict';
module.exports = class Driver module.exports = class Driver
constructor: (@name) -> constructor: (opts) ->
@name = opts.name

View File

@ -9,4 +9,5 @@
'use strict'; 'use strict';
module.exports = class Robot module.exports = class Robot
constructor: (@name) -> constructor: (opts) ->
@name = opts.name

View File

@ -3,8 +3,8 @@
Adaptor = source("adaptor") Adaptor = source("adaptor")
describe "basic tests", -> describe "basic tests", ->
r = new Adaptor("irobot") r = new Adaptor(name: "adaptive")
it "adaptor should have a name", -> it "adaptor should have a name", ->
r.should.have.keys 'name' r.should.have.keys 'name'
r.name.should.be.equal 'irobot' r.name.should.be.equal 'adaptive'

View File

@ -3,8 +3,8 @@
Connection = source("connection") Connection = source("connection")
describe "basic tests", -> describe "basic tests", ->
r = new Connection("irobot") r = new Connection(name: "connective")
it "connection should have a name", -> it "connection should have a name", ->
r.should.have.keys 'name' r.should.have.keys 'name'
r.name.should.be.equal 'irobot' r.name.should.be.equal 'connective'

View File

@ -3,8 +3,8 @@
Device = source("device") Device = source("device")
describe "basic tests", -> describe "basic tests", ->
r = new Device("irobot") r = new Device(name: "devisive")
it "device should have a name", -> it "device should have a name", ->
r.should.have.keys 'name' r.should.have.keys 'name'
r.name.should.be.equal 'irobot' r.name.should.be.equal 'devisive'

View File

@ -3,8 +3,8 @@
Driver = source("driver") Driver = source("driver")
describe "basic tests", -> describe "basic tests", ->
r = new Driver("irobot") r = new Driver(name: "driving")
it "driver should have a name", -> it "driver should have a name", ->
r.should.have.keys 'name' r.should.have.keys 'name'
r.name.should.be.equal 'irobot' r.name.should.be.equal 'driving'

View File

@ -3,7 +3,7 @@
Robot = source("robot") Robot = source("robot")
describe "basic tests", -> describe "basic tests", ->
r = new Robot("irobot") r = new Robot(name: "irobot")
it "robot should have a name", -> it "robot should have a name", ->
r.should.have.keys 'name' r.should.have.keys 'name'