[rspec-users] Test Design Question #2
patmaddox at me.com
Thu Mar 31 03:53:42 EDT 2011
Use mocks to define your interface, not to define TCPSocket directly. I would suggest running a TCP server just to test your wrapping object.
On Mar 30, 2011, at 9:34 AM, Curtis j Schofield wrote:
> I am designing a test around a class that interacts with TCPSocket - I
> have used a mock and have asserted as minimal an interface as I can -
> centered around the IO methods.
> Should i be using a stub instead and stub on open and read - instead
> of mock with open, read , close and so forth.
> Is there a good pattern for testing TCP servers in a unit-oriented way?
> I could make a micro server in the test - but that seems to be not
> what i really want.
> Thank you
> make haste slowly \
> festina lente \
> mobile +1_415_632_6001
> curtis.schofield at gmail.com
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users