Ways to Unit Test Oauth for different services in ruby?

Posted by viatropos on Stack Overflow See other posts from Stack Overflow or by viatropos
Published on 2010-05-28T22:39:37Z Indexed on 2010/05/28 22:42 UTC
Read the original article Hit count: 133

Are there any best practices in writing unit tests when 90% of the time I'm building the Oauth connecting class, I need to actually be logging into the remote service?

I am building a rubygem that logs in to Twitter/Google/MySpace, etc., and the hardest part is making sure I have the settings right for that particular provider, and I would like to write tests for that.

Is there a recommended way to do that? If I did mocks or stubs, I'd still have to spend that 90% of the time figuring out how to use the service, and would end up writing tests after the fact instead of before...

© Stack Overflow or respective owner

Related posts about ruby

Related posts about best-practices