-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from philip1986/development_xento
Development xento
- Loading branch information
Showing
10 changed files
with
285 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
sinon = require 'sinon' | ||
{ EventEmitter } = require 'events' | ||
MilightRF24 = require 'node-milight-rf24' | ||
|
||
# replace whole Controller class | ||
MilightRF24.MilightRF24Controller = class FakeMilightRF24Controller extends EventEmitter | ||
constructor: (@config) -> | ||
open: -> | ||
setColor: -> | ||
setBrightness: -> | ||
sendButton: -> | ||
|
||
class DriverStub | ||
@open = sinon.stub MilightRF24.MilightRF24Controller.prototype, 'open' | ||
@setColor = sinon.stub MilightRF24.MilightRF24Controller.prototype, 'setColor' | ||
@setBrightness = sinon.stub MilightRF24.MilightRF24Controller.prototype, 'setBrightness' | ||
@sendButton = sinon.stub MilightRF24.MilightRF24Controller.prototype, 'sendButton' | ||
|
||
@reset: -> | ||
@open.reset() | ||
@setColor.reset() | ||
@setBrightness.reset() | ||
@sendButton.reset() | ||
|
||
exports.DriverStub = DriverStub |
Oops, something went wrong.