octokit / go-octokit

Simple Go wrapper for the GitHub API
https://github.com/octokit/go-octokit
MIT License
258 stars 79 forks source link

Interfaces for clients, to make it easier to fake in unit tests? #123

Open half-ogre opened 8 years ago

half-ogre commented 8 years ago

@pengwynn, I'm curious what your thoughts are on using interfaces for the clients, to make it easier to fake them in unit tests? Currently I have an interface in my service code that proxies to the clients, so I can fake that in my tests. And I can live with that, but I wonder: if the clients themselves had interfaces, would that make life easier for others?

pengwynn commented 8 years ago

@half-ogre it's an interesting idea. I'd want to play with it on a couple of API domains.

My long-term dream to make testing easier is a Golang version of VCR which makes Octokit.rb testing replayable and refreshable from the actual server.