Skip to content

Instantly share code, notes, and snippets.

@mdub
Created September 5, 2009 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdub/181381 to your computer and use it in GitHub Desktop.
Save mdub/181381 to your computer and use it in GitHub Desktop.
def stub_rest_client(method, url = nil, options = {}, &block)
options = options.dup
options[:method] = method
options[:url] = url.to_s if url
stub(RestClient::Request).execute(hash_including(options), &block)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment