January 2016 Archives

Mocking a User Agent

My last assignment in the CPAN Pull Request Challenge 2015 was Net::Stripe. I’d never heard of the module, so I skimmed its documentation to learn it provides an API to Stripe.com. From the method list, it seemed to be some kind of a payment service. It had no tester failures, though, and the issues on GitHub were either too complex or not specific enough to give me an idea on what to start working. I asked in the Challenge’s IRC channel and got the following advice from Joel Berger and Ether:

jberger	choroba: I haven’t looked at that module, but almost
	all service wrapper modules have woeful tests because
	they require the service
...	contributing some mock service tests might be nice
	and something you could do without an account (at least
	in concept)
ether	Test::LWP::UserAgent!!

About E. Choroba

user-pic I blog about Perl.