Typhoeus issue #255

Closed
t3hk0d3 opened this Issue Feb 20, 2013 · 10 comments

Projects

None yet

3 participants

@t3hk0d3
t3hk0d3 commented Feb 20, 2013
$ ruby -Itest test/performance/browsing_test.rb 
/home/t3hk0d3/.rvm/gems/ruby-1.9.3-p385/gems/webmock-1.9.2/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb:50:in `remove_after_request_callback': undefined method `on_complete' for Typhoeus:Module (NoMethodError)
        from /home/t3hk0d3/.rvm/gems/ruby-1.9.3-p385/gems/webmock-1.9.2/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb:24:in `disable!'
        from /home/t3hk0d3/.rvm/gems/ruby-1.9.3-p385/gems/webmock-1.9.2/lib/webmock/webmock.rb:39:in `block in enable!'
        from /home/t3hk0d3/.rvm/gems/ruby-1.9.3-p385/gems/webmock-1.9.2/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb:16:in `each'
        from /home/t3hk0d3/.rvm/gems/ruby-1.9.3-p385/gems/webmock-1.9.2/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb:16:in `each_adapter'
        from /home/t3hk0d3/.rvm/gems/ruby-1.9.3-p385/gems/webmock-1.9.2/lib/webmock/webmock.rb:38:in `enable!'
        from /home/t3hk0d3/.rvm/gems/ruby-1.9.3-p385/gems/webmock-1.9.2/lib/webmock/webmock.rb:123:in `<module:WebMock>'
        from /home/t3hk0d3/.rvm/gems/ruby-1.9.3-p385/gems/webmock-1.9.2/lib/webmock/webmock.rb:1:in `<top (required)>'
        from /home/t3hk0d3/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /home/t3hk0d3/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /home/t3hk0d3/.rvm/gems/ruby-1.9.3-p385/gems/webmock-1.9.2/lib/webmock.rb:48:in `<top (required)>'
        from /home/t3hk0d3/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
        from /home/t3hk0d3/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
        from /home/t3hk0d3/.rvm/gems/ruby-1.9.3-p385/gems/webmock-1.9.2/lib/webmock/test_unit.rb:2:in `<top (required)>'
        from /home/t3hk0d3/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
        from /home/t3hk0d3/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
        from /home/t3hk0d3/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
        from /home/t3hk0d3/projects/[censored]/test/test_helper.rb:3:in `<top (required)>'
        from /home/t3hk0d3/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /home/t3hk0d3/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from test/performance/browsing_test.rb:1:in `<main>'
$ cat Gemfile.lock  | grep typho | wc -l
0

UPDATE Not reproduceable with 1.8.11, only 1.9.*

Owner
bblimke commented Feb 20, 2013

This code only executes in Typhoeus constant is defined.
Can you please check if by any chance Typhoeus constant is loaded before WebMock is required?

t3hk0d3 commented Feb 20, 2013

@bblimke
rails console said Typhoeus constant is undefined.

Owner
bblimke commented Feb 20, 2013

I'm not able to help without reproducing it. Are you able to provide a sample code?

@bblimke bblimke closed this Feb 28, 2013
ajsharp commented Apr 3, 2013

I'm seeing this as well. We're using Typhoeus in the project.

Can you please check if by any chance Typhoeus constant is loaded before WebMock is required?

Does Typhoeus need to be loaded after webmock?

Owner
bblimke commented Apr 3, 2013

Do you use the latest version of WebMock and Typhoeus?

Typhoeus should be loaded before WebMock.

ajsharp commented Apr 3, 2013

Yea, we're using Typhoeus 0.4.2 and loading it before. It doesn't look like Typhoeus has an "on_complete" method...

ajsharp commented Apr 3, 2013

Oh nevermind, I see it now. Yea, very odd. I'll keep investigating.

Owner
bblimke commented Apr 3, 2013

Latest typhoeus is 0.6.2 not 0.4.2 and latest webmock is 1.11.0

ajsharp commented Apr 3, 2013

Ah, gotcha. Yea the on_complete method is defined on the Typhoeus::Hydra and Request classes in 0.4.x.

ajsharp commented Apr 8, 2013

Thanks, upgrading to latest of both fixed the issue.

On Wed, Apr 3, 2013 at 12:22 PM, Bartosz Blimke notifications@github.comwrote:

Latest typhoeus is 0.6.2 not 0.4.2 and latest webmock is 1.11.0


Reply to this email directly or view it on GitHubhttps://github.com/bblimke/webmock/issues/255#issuecomment-15858669
.

Cheers,

alex sharp

https://twitter.com/ajsharp
http://alexjsharp.com

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