Use mocks to define your interface, not to define TCPSocket directly. I would
suggest running a TCP server just to test your wrapping object.
Pat
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
> http://robotarmyma.de
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users