Curb support #45

Merged
23 commits merged into from Oct 4, 2010

Conversation

Projects
None yet
1 participant
@phiggins
Contributor

phiggins commented Oct 4, 2010

Enable WebMock to mock calls to Curb. There are likely cases I have not covered, but I figured I had done enough monkey-patching for now. At this point it would probably be easier to rewrite curb to be more ruby-ish than continue the way I was going.

A concise demo of just why I had to do inflate your spec count by 2x is here: http://gist.github.com/609286

phiggins added some commits Aug 17, 2010

Divide and conquer.
Curb's Curl::Easy class appears to have three ways of doing http calls:
calling #http with the method as a parameter, calling the #http_* methods,
and calling #perform. All of these are basically the same but use
independent code paths.
Add support for Curl::Easy's #http_#{verb} methods.
Will likely need to change #post and #put because those both take
arguments.
Modify many codes to get PUT spec to pass.
Also, DRY up some stuff, and move some logic out of curb_spec_helper.rb
to make stuff behave like it would if you were actually WebMock'ing
curb.
Organize things a bit, and change some stuff for <1.9 compat.
Specifically, I had to replace calls to define_singleton_method to using
the singleton class and define_method.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment