kylejginavan / youtube_it

An object-oriented Ruby wrapper for the YouTube GData API
http://groups.google.com/group/ruby-youtube-library
595 stars 223 forks source link

OAuth2Client#refresh_access_token! should cause new client to be created #68

Closed yaauie closed 12 years ago

yaauie commented 12 years ago

OAuth2Client#client continues to reference original token, even after refreshing. This patch deletes the cached @client so it will be regenerated on next request.

Note: Destructive action is wrapped in a Thread.exclusive to make the action thread-safe.

yaauie commented 12 years ago

I've manually tested this patch to ensure it works; since there is no YouTubeIt::OAuth2Client coverage at all, I don't have tokens to test with. If you generate the API tokens I'll gladly write test coverage for this case.

chebyte commented 12 years ago

ey @yaauie I added the api tokens, this is in test/test_client.rb, so you are available for add the test for this case, when you want

thanks!