From: Michael Guterl Date: 2008-12-25T10:06:32+09:00 Subject: Re: Testing Data Scrapes On Wed, Dec 24, 2008 at 7:20 PM, Michael Boutros wrote: > Hello all, > > I'm here not for code help, but more for some opinions. At the moment > I'm writing a library to interact with Snipt. However, I have no idea > how to test it. I don't want to include my username and password in the > tests, and I know if I create a test account and leave the credentials > in some jerk will login to the account and change the password. This > doesn't just apply to Snipt, but rather to any library that connects to > a web service. Thoughts? > Any time that I am testing an external service like this, I tend to cache the response as a fixture and use mocks or stubs in place of the actual call to the service. If you're using test/unit I'd use Flexmock or Mocha, RSpec has a mocking/stubbing component built in. HTH, Michael Guterl