voodootikigod/node-serialport — pull request #242 by reconbot (2013-10-29 04:11:24+00:00)
Title: Mock SerialPortBindings

I'd like a bit of review as this makes a structural change to the SerialPortFactory albeit minor.
- Modify the SerialPortFactory to keep the SerialPortBinding as a static property instead of using the modules local variable. This allows the bindings to be replaced at run time for testing and other nefarious deeds.
- Add a mock for SerialPortBinding and modify the tests to use it. This includes examples of mocking functions to simulate failures, spying on method calls to ensure they were called and the expects flavor of mocha assertions.
- Splits parsers into their own file.

This also provides the framework for us to address #238 without needing hardware during tests. =)