Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Typhoeus issue #255

Closed
t3hk0d3 opened this Issue · 10 comments

3 participants

@t3hk0d3
$ 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.*

@bblimke
Owner

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

@bblimke
rails console said Typhoeus constant is undefined.

@bblimke
Owner

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

@bblimke bblimke closed this
@ajsharp

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?

@bblimke
Owner

Do you use the latest version of WebMock and Typhoeus?

Typhoeus should be loaded before WebMock.

@ajsharp

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

@ajsharp

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

@bblimke
Owner

Latest typhoeus is 0.6.2 not 0.4.2 and latest webmock is 1.11.0

@ajsharp

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

@ajsharp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.