   suite.run();
 }
 
-class InMemoryStream : public Stream
-{
-public:
-  virtual ~InMemoryStream() 
-  {
-  }
-
-  size_t write(uint8_t val)
-  {
-    _bytesWritten += (char) val;
-
-    return size_t(1);
-  }
-
-  void flush() 
-  {
-  }
-
-  const String& bytesWritten() 
-  {
-    return _bytesWritten;
-  }
-
-  void nextByte(byte b)
-  {
-    _nextByte = b;
-  }
-
-  int available() 
-  {
-    return 1;
-  }
-
-  int read() 
-  {
-    return _nextByte;
-  }
-
-  int peek()
-  {
-    return _nextByte;
-  }
-
-private:
-  String _bytesWritten;
-  byte _nextByte;
-};
-
 void assertStringsEqual(Test& __test__, const char* expected, const String& actual)
 {
   size_t expectedLength = strlen(expected);


void processMessage(const byte* message, size_t length)
{
  InMemoryStream stream;
  Firmata.begin(stream);

  for (size_t i = 0; i < length; i++)


test(beginPrintsVersion)
{
  FakeStream stream;

  Firmata.begin(stream);

  char expected[] = 
  {
    REPORT_VERSION,
    FIRMATA_MAJOR_VERSION,
    FIRMATA_MINOR_VERSION,
    0
  };
  assertStringsEqual(__test__, expected, stream.bytesWritten());
