I have a project where I am working with OAuth and Quickbooks gems and I’m trying to figure out how to tdd my project against these external dependencies. I’ve see where @joshclayton has developed fakes in the tdd workshop and geo coding on rails book, but I’m still struggling with the concept. I usually run into issues getting my code to run the fake implementation, or developing a fake that I can easily control the results of. I also occasionally have issues where my fakes API drifts away from the actual object’s API and I don’t notice it until something breaks.
Any tips or resources for doing TDD with external services would be greatly appreciated. Also, I’ve heard people talk about creating a thin wrapper around external gems to allow easier faking, but I’m still struggling around how to build one effectively.
Thanks in advance for your help. I hope you come out with a book like ruby science for testing in the near future.