Created
April 21, 2015 05:54
-
-
Save 0xCCD/d5c4b71e646f8a0c26ef to your computer and use it in GitHub Desktop.
webmock-curb-issue
This file contains hidden or 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
| source 'https://rubygems.org' | |
| group 'development', 'test' do | |
| gem 'curb' | |
| gem 'webmock' | |
| end |
This file contains hidden or 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
| #!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you, helped to fix :) Was this issue reported somewhere?