From b0f4d9f12b9ddb1f3152579eb27f08240357f1f5 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Sat, 19 Oct 2013 18:32:59 -0700 Subject: [PATCH] Name is just an option --- src/adaptor.coffee | 3 ++- src/connection.coffee | 3 ++- src/device.coffee | 3 ++- src/driver.coffee | 3 ++- src/robot.coffee | 3 ++- test/src/specs/adaptor.spec.coffee | 4 ++-- test/src/specs/connection.spec.coffee | 4 ++-- test/src/specs/device.spec.coffee | 4 ++-- test/src/specs/driver.spec.coffee | 4 ++-- test/src/specs/robot.spec.coffee | 2 +- 10 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/adaptor.coffee b/src/adaptor.coffee index 2784ab7..5e5545c 100644 --- a/src/adaptor.coffee +++ b/src/adaptor.coffee @@ -9,4 +9,5 @@ 'use strict'; module.exports = class Adaptor - constructor: (@name) -> + constructor: (opts) -> + @name = opts.name diff --git a/src/connection.coffee b/src/connection.coffee index b122a37..b3ed3da 100644 --- a/src/connection.coffee +++ b/src/connection.coffee @@ -9,4 +9,5 @@ 'use strict'; module.exports = class Connection - constructor: (@name) -> + constructor: (opts) -> + @name = opts.name diff --git a/src/device.coffee b/src/device.coffee index fa3b826..7fb585c 100644 --- a/src/device.coffee +++ b/src/device.coffee @@ -9,4 +9,5 @@ 'use strict'; module.exports = class Device - constructor: (@name) -> + constructor: (opts) -> + @name = opts.name diff --git a/src/driver.coffee b/src/driver.coffee index 1308a9f..799d5cf 100644 --- a/src/driver.coffee +++ b/src/driver.coffee @@ -9,4 +9,5 @@ 'use strict'; module.exports = class Driver - constructor: (@name) -> + constructor: (opts) -> + @name = opts.name diff --git a/src/robot.coffee b/src/robot.coffee index f80a00f..ece5121 100644 --- a/src/robot.coffee +++ b/src/robot.coffee @@ -9,4 +9,5 @@ 'use strict'; module.exports = class Robot - constructor: (@name) -> + constructor: (opts) -> + @name = opts.name diff --git a/test/src/specs/adaptor.spec.coffee b/test/src/specs/adaptor.spec.coffee index 8970e4f..fc4c377 100644 --- a/test/src/specs/adaptor.spec.coffee +++ b/test/src/specs/adaptor.spec.coffee @@ -3,8 +3,8 @@ Adaptor = source("adaptor") describe "basic tests", -> - r = new Adaptor("irobot") + r = new Adaptor(name: "adaptive") it "adaptor should have a name", -> r.should.have.keys 'name' - r.name.should.be.equal 'irobot' + r.name.should.be.equal 'adaptive' diff --git a/test/src/specs/connection.spec.coffee b/test/src/specs/connection.spec.coffee index cd4b7bf..2d62462 100644 --- a/test/src/specs/connection.spec.coffee +++ b/test/src/specs/connection.spec.coffee @@ -3,8 +3,8 @@ Connection = source("connection") describe "basic tests", -> - r = new Connection("irobot") + r = new Connection(name: "connective") it "connection should have a name", -> r.should.have.keys 'name' - r.name.should.be.equal 'irobot' + r.name.should.be.equal 'connective' diff --git a/test/src/specs/device.spec.coffee b/test/src/specs/device.spec.coffee index 2bac35d..8a23bf1 100644 --- a/test/src/specs/device.spec.coffee +++ b/test/src/specs/device.spec.coffee @@ -3,8 +3,8 @@ Device = source("device") describe "basic tests", -> - r = new Device("irobot") + r = new Device(name: "devisive") it "device should have a name", -> r.should.have.keys 'name' - r.name.should.be.equal 'irobot' + r.name.should.be.equal 'devisive' diff --git a/test/src/specs/driver.spec.coffee b/test/src/specs/driver.spec.coffee index b85e30d..9e816a6 100644 --- a/test/src/specs/driver.spec.coffee +++ b/test/src/specs/driver.spec.coffee @@ -3,8 +3,8 @@ Driver = source("driver") describe "basic tests", -> - r = new Driver("irobot") + r = new Driver(name: "driving") it "driver should have a name", -> r.should.have.keys 'name' - r.name.should.be.equal 'irobot' + r.name.should.be.equal 'driving' diff --git a/test/src/specs/robot.spec.coffee b/test/src/specs/robot.spec.coffee index c8f0d2f..032855e 100644 --- a/test/src/specs/robot.spec.coffee +++ b/test/src/specs/robot.spec.coffee @@ -3,7 +3,7 @@ Robot = source("robot") describe "basic tests", -> - r = new Robot("irobot") + r = new Robot(name: "irobot") it "robot should have a name", -> r.should.have.keys 'name'