segmentio / nsq-go

Go package providing tools for building NSQ clients, servers and middleware.
MIT License
100 stars 20 forks source link

feat(message): add factory for use in tests #23

Closed dominicbarnes closed 7 years ago

dominicbarnes commented 7 years ago

This adds a factory method for creating ad-hoc Message instances. In particular, this is necessary because cmdChan is private. This allows writing tests that accept a Message where you can assert that the expected Command is sent along the channel. (also, calling Finish or Requeue an message w/o this channel will panic)