Skip to content

Instantly share code, notes, and snippets.

@0xCCD
Created April 21, 2015 05:54
Show Gist options
  • Select an option

  • Save 0xCCD/d5c4b71e646f8a0c26ef to your computer and use it in GitHub Desktop.

Select an option

Save 0xCCD/d5c4b71e646f8a0c26ef to your computer and use it in GitHub Desktop.
webmock-curb-issue
source 'https://rubygems.org'
group 'development', 'test' do
gem 'curb'
gem 'webmock'
end
#!/usr/bin/ruby
require 'curb'
require 'webmock'
WebMock.disable_net_connect!
url = 'www.example.com'
# fail with curb-0.8.8/lib/curl/easy.rb:24:in `status': undefined method `strip' for nil:NilClass
WebMock.stub_request(:any, url).to_return(body: "abc", status: 200)
# works becaus of the addtional message part
# WebMock.stub_request(:any, url).to_return(body: "abc", status: [200,'OK'])
http = Curl.get(url)
puts http.status
c = Curl::Easy.new(url)
c.perform
puts c.status
@glebsts
Copy link

glebsts commented Mar 1, 2016

Thank you, helped to fix :) Was this issue reported somewhere?

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