From: Michael Boutros Date: 2008-12-25T13:55:08+09:00 Subject: Re: Testing Data Scrapes Michael, Thanks for the link to Mocha, it looks like what I need. However, I still don't understand what to do to test live data. This is my project: http://github.com/michaelboutros/rsnipt/tree/master. How would you go at what I'm trying to do? Thanks, Michael Boutros Michael Guterl wrote: > 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 -- Posted via http://www.ruby-forum.com/.