E
Enrique Comba Riepenhausen
I am currently finishing up a release of Rannel, a library for
sending sms messages through the open source SMS/WAP Gateway Kannel.
I have a couple of Unit tests that assure that the commands are send
correctly to Kannel and all the tests are passing (i.e. it's
working ).
Looking at the unit test code though, I realized, that I am violating
one of the unit test premisses; The Independence of the Tests!
Therefore I thought that I could mock up the Net::HTTP requests done
to Kannel, but my problem here is that I am not quite sure how I can
do that, as the adapters (for GET and POST requests) actually use
this package (Net::HTTP).
What would you recommend? Should I write a MockGet/Post adapter that
will do the job? Or is there a transparent way to change the behavior
of Net::HTTP without touching the adapters?
Thank you in advance,
Enrique Comba Riepenhausen
sending sms messages through the open source SMS/WAP Gateway Kannel.
I have a couple of Unit tests that assure that the commands are send
correctly to Kannel and all the tests are passing (i.e. it's
working ).
Looking at the unit test code though, I realized, that I am violating
one of the unit test premisses; The Independence of the Tests!
Therefore I thought that I could mock up the Net::HTTP requests done
to Kannel, but my problem here is that I am not quite sure how I can
do that, as the adapters (for GET and POST requests) actually use
this package (Net::HTTP).
What would you recommend? Should I write a MockGet/Post adapter that
will do the job? Or is there a transparent way to change the behavior
of Net::HTTP without touching the adapters?
Thank you in advance,
Enrique Comba Riepenhausen