Not raising an ArgumentError had slipped through the cracks. The test case exist.

We have to make sure it's a string if no other class is allowed. NoMethodError is raised on e.g. 3.empty?.
Raising a generic Exception is probably not a good idea here.

How about raising a runtime error with the error message WebSocket provides?

1. http://stackoverflow.com/a/10048406
Merge pull request #36 from emnl/correct-exceptions

Correct exceptions