Created
February 14, 2013 10:48
-
-
Save Haegin/4951986 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm trying to test a code path that is hit when a function I'm calling raises an OAuth2::Error exception. | |
https://github.com/intridea/oauth2/blob/master/lib/oauth2/error.rb | |
OAuth2::Error takes in a response as a parameter but I really don't care about this and just want to mock this all out. | |
Currently I have the following: | |
setup do | |
@thing = flexmock(Thing.new(c)) | |
@thing.should_receive('client').and_raise(OAuth2::Error) | |
end | |
should "handle an oAuth error correctly" do | |
@thing.do_fetch_token('arg') # this should raise the error, I'll wrap it in a should raise thing once it's working | |
end | |
Currently it throws a hissy fit because the wrong arguments are getting passed to OAuth2::Error. How can I fix this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment