Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add regression spec for typhoeus/VCR bug found by @jeg2.

For more details, see:
- https://twitter.com/jeg2/status/271006838852579328
- https://gist.github.com/4121410
- typhoeus/typhoeus#240

The fix for the spec was simply updating Typhoeus (now that the
bug has been fixed there and @i0rek cut a release). I had some weird
issues updating Typhoeus where it didn't include ethon in the bundle,
though, so I deleted my Gemfile.lock and re-bundled so it would get
pulled in.
  • Loading branch information...
commit 3bd2f22655f469b3dab9bbb808aa00be4f5eb4f1 1 parent f75353b
Myron Marston authored
45 Gemfile.lock
View
@@ -7,7 +7,7 @@ GEM
remote: http://rubygems.org/
specs:
addressable (2.3.2)
- appraisal (0.4.1)
+ appraisal (0.5.1)
bundler
rake
archive-tar-minitar (0.5.2)
@@ -16,7 +16,6 @@ GEM
cucumber (>= 1.1.1)
ffi (>= 1.0.11)
rspec (>= 2.7.0)
- bouncy-castle-java (1.5.0146.1)
builder (3.1.4)
childprocess (0.3.6)
ffi (~> 1.0, >= 1.0.6)
@@ -29,14 +28,14 @@ GEM
gherkin (~> 2.9.0)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
- curb (0.8.1)
- debugger (1.2.1)
+ curb (0.8.3)
+ debugger (1.2.2)
columnize (>= 0.3.1)
debugger-linecache (~> 1.1.1)
- debugger-ruby_core_source (~> 1.1.4)
+ debugger-ruby_core_source (~> 1.1.5)
debugger-linecache (1.1.2)
debugger-ruby_core_source (>= 1.1.1)
- debugger-ruby_core_source (1.1.4)
+ debugger-ruby_core_source (1.1.5)
diff-lcs (1.1.3)
em-http-request (1.0.3)
addressable (>= 2.2.3)
@@ -46,17 +45,15 @@ GEM
http_parser.rb (>= 0.5.3)
em-socksify (0.2.1)
eventmachine (>= 1.0.0.beta.4)
- ethon (0.5.4)
+ ethon (0.5.6)
ffi (~> 1.1.5)
mime-types (~> 1.18)
eventmachine (1.0.0)
- eventmachine (1.0.0-java)
- excon (0.16.7)
+ excon (0.16.10)
fakeweb (1.3.0)
faraday (0.8.4)
multipart-post (~> 1.1)
ffi (1.1.5)
- ffi (1.1.5-java)
fuubar (1.0.0)
rspec (~> 2.0)
rspec-instafail (~> 0.2.0)
@@ -66,16 +63,10 @@ GEM
ruby-progressbar (~> 0.0.10)
gherkin (2.9.3)
json (>= 1.4.6)
- gherkin (2.9.3-java)
- json (>= 1.4.6)
github-markup (0.7.4)
http_parser.rb (0.5.3)
- http_parser.rb (0.5.3-java)
httpclient (2.3.0.1)
- jruby-openssl (0.7.7)
- bouncy-castle-java (>= 1.5.0146.1)
json (1.6.7)
- json (1.6.7-java)
linecache (0.46)
rbx-require-relative (> 0.0.4)
mime-types (1.19)
@@ -85,7 +76,7 @@ GEM
rack (1.3.6)
rack-protection (1.2.0)
rack
- rake (0.9.2.2)
+ rake (0.9.5)
rbx-require-relative (0.0.9)
redcarpet (1.17.2)
redis (2.2.2)
@@ -95,21 +86,20 @@ GEM
rest-client (>= 1.6.1)
rest-client (1.6.7)
mime-types (>= 1.16)
- rspec (2.11.0)
- rspec-core (~> 2.11.0)
- rspec-expectations (~> 2.11.0)
- rspec-mocks (~> 2.11.0)
- rspec-core (2.11.1)
- rspec-expectations (2.11.3)
+ rspec (2.12.0)
+ rspec-core (~> 2.12.0)
+ rspec-expectations (~> 2.12.0)
+ rspec-mocks (~> 2.12.0)
+ rspec-core (2.12.0)
+ rspec-expectations (2.12.0)
diff-lcs (~> 1.1.3)
rspec-instafail (0.2.4)
- rspec-mocks (2.11.3)
+ rspec-mocks (2.12.0)
ruby-debug (0.10.4)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.4.0)
ruby-debug-base (0.10.4)
linecache (>= 0.3)
- ruby-debug-base (0.10.4-java)
ruby-progressbar (0.0.10)
shoulda (2.9.2)
simplecov (0.5.4)
@@ -123,7 +113,7 @@ GEM
term-ansicolor (1.0.7)
tilt (1.3.3)
timecop (0.3.5)
- typhoeus (0.5.2)
+ typhoeus (0.5.3)
ethon (~> 0.5.3)
webmock (1.9.0)
addressable (>= 2.2.7)
@@ -132,7 +122,6 @@ GEM
yard (0.8.3)
PLATFORMS
- java
ruby
DEPENDENCIES
@@ -165,7 +154,7 @@ DEPENDENCIES
simplecov (~> 0.5.3)
sinatra (~> 1.3.2)
timecop (~> 0.3.5)
- typhoeus (~> 0.5)
+ typhoeus (~> 0.5.3)
vcr!
webmock (~> 1.9)
yajl-ruby (~> 1.1.0)
17 gemfiles/typhoeus_new.gemfile
View
@@ -0,0 +1,17 @@
+# This file was generated by Appraisal
+
+source :rubygems
+
+gem "appraisal"
+gem "jruby-openssl", :platforms=>:jruby
+gem "yard"
+gem "relish", "~> 0.6"
+gem "fuubar"
+gem "fuubar-cucumber"
+gem "redcarpet", "~> 1.17.2"
+gem "github-markup"
+gem "ruby-debug", :platforms=>[:mri_18, :jruby]
+gem "debugger", :platforms=>:mri_19
+gem "typhoeus", "~> 0.5"
+
+gemspec :path=>"../"
161 gemfiles/typhoeus_new.gemfile.lock
View
@@ -0,0 +1,161 @@
+PATH
+ remote: /Users/myron/code/vcr
+ specs:
+ vcr (2.3.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ addressable (2.3.2)
+ appraisal (0.5.1)
+ bundler
+ rake
+ archive-tar-minitar (0.5.2)
+ aruba (0.4.11)
+ childprocess (>= 0.2.3)
+ cucumber (>= 1.1.1)
+ ffi (>= 1.0.11)
+ rspec (>= 2.7.0)
+ builder (3.1.4)
+ childprocess (0.3.6)
+ ffi (~> 1.0, >= 1.0.6)
+ columnize (0.3.6)
+ cookiejar (0.3.0)
+ crack (0.3.1)
+ cucumber (1.1.9)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.2)
+ gherkin (~> 2.9.0)
+ json (>= 1.4.6)
+ term-ansicolor (>= 1.0.6)
+ curb (0.8.3)
+ debugger (1.2.2)
+ columnize (>= 0.3.1)
+ debugger-linecache (~> 1.1.1)
+ debugger-ruby_core_source (~> 1.1.5)
+ debugger-linecache (1.1.2)
+ debugger-ruby_core_source (>= 1.1.1)
+ debugger-ruby_core_source (1.1.5)
+ diff-lcs (1.1.3)
+ em-http-request (1.0.3)
+ addressable (>= 2.2.3)
+ cookiejar
+ em-socksify
+ eventmachine (>= 1.0.0.beta.4)
+ http_parser.rb (>= 0.5.3)
+ em-socksify (0.2.1)
+ eventmachine (>= 1.0.0.beta.4)
+ ethon (0.5.6)
+ ffi (~> 1.1.5)
+ mime-types (~> 1.18)
+ eventmachine (1.0.0)
+ excon (0.16.10)
+ fakeweb (1.3.0)
+ faraday (0.8.4)
+ multipart-post (~> 1.1)
+ ffi (1.1.5)
+ fuubar (1.0.0)
+ rspec (~> 2.0)
+ rspec-instafail (~> 0.2.0)
+ ruby-progressbar (~> 0.0.10)
+ fuubar-cucumber (0.0.15)
+ cucumber (>= 1.0.2)
+ ruby-progressbar (~> 0.0.10)
+ gherkin (2.9.3)
+ json (>= 1.4.6)
+ github-markup (0.7.4)
+ http_parser.rb (0.5.3)
+ httpclient (2.3.0.1)
+ json (1.6.7)
+ linecache (0.46)
+ rbx-require-relative (> 0.0.4)
+ mime-types (1.19)
+ multi_json (1.0.4)
+ multipart-post (1.1.5)
+ patron (0.4.18)
+ rack (1.3.6)
+ rack-protection (1.2.0)
+ rack
+ rake (0.9.5)
+ rbx-require-relative (0.0.9)
+ redcarpet (1.17.2)
+ redis (2.2.2)
+ relish (0.6)
+ archive-tar-minitar (>= 0.5.2)
+ json (>= 1.4.6)
+ rest-client (>= 1.6.1)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
+ rspec (2.12.0)
+ rspec-core (~> 2.12.0)
+ rspec-expectations (~> 2.12.0)
+ rspec-mocks (~> 2.12.0)
+ rspec-core (2.12.0)
+ rspec-expectations (2.12.0)
+ diff-lcs (~> 1.1.3)
+ rspec-instafail (0.2.4)
+ rspec-mocks (2.12.0)
+ ruby-debug (0.10.4)
+ columnize (>= 0.1)
+ ruby-debug-base (~> 0.10.4.0)
+ ruby-debug-base (0.10.4)
+ linecache (>= 0.3)
+ ruby-progressbar (0.0.10)
+ shoulda (2.9.2)
+ simplecov (0.5.4)
+ multi_json (~> 1.0.3)
+ simplecov-html (~> 0.5.3)
+ simplecov-html (0.5.3)
+ sinatra (1.3.3)
+ rack (~> 1.3, >= 1.3.6)
+ rack-protection (~> 1.2)
+ tilt (~> 1.3, >= 1.3.3)
+ term-ansicolor (1.0.7)
+ tilt (1.3.3)
+ timecop (0.3.5)
+ typhoeus (0.5.3)
+ ethon (~> 0.5.3)
+ webmock (1.9.0)
+ addressable (>= 2.2.7)
+ crack (>= 0.1.7)
+ yajl-ruby (1.1.0)
+ yard (0.8.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ appraisal
+ aruba (~> 0.4.11)
+ bundler (>= 1.0.7)
+ cucumber (~> 1.1.4)
+ curb (~> 0.8.0)
+ debugger
+ em-http-request (~> 1.0.2)
+ excon (>= 0.11.0, < 1.0)
+ fakeweb (~> 1.3.0)
+ faraday (~> 0.8)
+ fuubar
+ fuubar-cucumber
+ github-markup
+ httpclient (~> 2.2)
+ jruby-openssl
+ json (~> 1.6.5)
+ multi_json (~> 1.0.3)
+ patron (~> 0.4.15)
+ rack (~> 1.3.6)
+ rake (~> 0.9.2)
+ redcarpet (~> 1.17.2)
+ redis (~> 2.2.2)
+ relish (~> 0.6)
+ rspec (~> 2.11)
+ ruby-debug
+ shoulda (~> 2.9.2)
+ simplecov (~> 0.5.3)
+ sinatra (~> 1.3.2)
+ timecop (~> 0.3.5)
+ typhoeus (~> 0.5)
+ vcr!
+ webmock (~> 1.9)
+ yajl-ruby (~> 1.1.0)
+ yard
18 gemfiles/typhoeus_old.gemfile
View
@@ -0,0 +1,18 @@
+# This file was generated by Appraisal
+
+source :rubygems
+
+gem "appraisal"
+gem "jruby-openssl", :platforms=>:jruby
+gem "yard"
+gem "relish", "~> 0.6"
+gem "fuubar"
+gem "fuubar-cucumber"
+gem "redcarpet", "~> 1.17.2"
+gem "github-markup"
+gem "ruby-debug", :platforms=>[:mri_18, :jruby]
+gem "debugger", :platforms=>:mri_19
+gem "typhoeus", "~> 0.4.2"
+gem "webmock", "1.8.11"
+
+gemspec :path=>"../"
159 gemfiles/typhoeus_old.gemfile.lock
View
@@ -0,0 +1,159 @@
+PATH
+ remote: /Users/myron/code/vcr
+ specs:
+ vcr (2.3.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ addressable (2.3.2)
+ appraisal (0.5.1)
+ bundler
+ rake
+ archive-tar-minitar (0.5.2)
+ aruba (0.4.11)
+ childprocess (>= 0.2.3)
+ cucumber (>= 1.1.1)
+ ffi (>= 1.0.11)
+ rspec (>= 2.7.0)
+ builder (3.1.4)
+ childprocess (0.3.6)
+ ffi (~> 1.0, >= 1.0.6)
+ columnize (0.3.6)
+ cookiejar (0.3.0)
+ crack (0.3.1)
+ cucumber (1.1.9)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.2)
+ gherkin (~> 2.9.0)
+ json (>= 1.4.6)
+ term-ansicolor (>= 1.0.6)
+ curb (0.8.3)
+ debugger (1.2.2)
+ columnize (>= 0.3.1)
+ debugger-linecache (~> 1.1.1)
+ debugger-ruby_core_source (~> 1.1.5)
+ debugger-linecache (1.1.2)
+ debugger-ruby_core_source (>= 1.1.1)
+ debugger-ruby_core_source (1.1.5)
+ diff-lcs (1.1.3)
+ em-http-request (1.0.3)
+ addressable (>= 2.2.3)
+ cookiejar
+ em-socksify
+ eventmachine (>= 1.0.0.beta.4)
+ http_parser.rb (>= 0.5.3)
+ em-socksify (0.2.1)
+ eventmachine (>= 1.0.0.beta.4)
+ eventmachine (1.0.0)
+ excon (0.16.10)
+ fakeweb (1.3.0)
+ faraday (0.8.4)
+ multipart-post (~> 1.1)
+ ffi (1.2.0)
+ fuubar (1.0.0)
+ rspec (~> 2.0)
+ rspec-instafail (~> 0.2.0)
+ ruby-progressbar (~> 0.0.10)
+ fuubar-cucumber (0.0.15)
+ cucumber (>= 1.0.2)
+ ruby-progressbar (~> 0.0.10)
+ gherkin (2.9.3)
+ json (>= 1.4.6)
+ github-markup (0.7.4)
+ http_parser.rb (0.5.3)
+ httpclient (2.3.0.1)
+ json (1.6.7)
+ linecache (0.46)
+ rbx-require-relative (> 0.0.4)
+ mime-types (1.19)
+ multi_json (1.0.4)
+ multipart-post (1.1.5)
+ patron (0.4.18)
+ rack (1.3.6)
+ rack-protection (1.2.0)
+ rack
+ rake (0.9.5)
+ rbx-require-relative (0.0.9)
+ redcarpet (1.17.2)
+ redis (2.2.2)
+ relish (0.6)
+ archive-tar-minitar (>= 0.5.2)
+ json (>= 1.4.6)
+ rest-client (>= 1.6.1)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
+ rspec (2.12.0)
+ rspec-core (~> 2.12.0)
+ rspec-expectations (~> 2.12.0)
+ rspec-mocks (~> 2.12.0)
+ rspec-core (2.12.0)
+ rspec-expectations (2.12.0)
+ diff-lcs (~> 1.1.3)
+ rspec-instafail (0.2.4)
+ rspec-mocks (2.12.0)
+ ruby-debug (0.10.4)
+ columnize (>= 0.1)
+ ruby-debug-base (~> 0.10.4.0)
+ ruby-debug-base (0.10.4)
+ linecache (>= 0.3)
+ ruby-progressbar (0.0.10)
+ shoulda (2.9.2)
+ simplecov (0.5.4)
+ multi_json (~> 1.0.3)
+ simplecov-html (~> 0.5.3)
+ simplecov-html (0.5.3)
+ sinatra (1.3.3)
+ rack (~> 1.3, >= 1.3.6)
+ rack-protection (~> 1.2)
+ tilt (~> 1.3, >= 1.3.3)
+ term-ansicolor (1.0.7)
+ tilt (1.3.3)
+ timecop (0.3.5)
+ typhoeus (0.4.2)
+ ffi (~> 1.0)
+ mime-types (~> 1.18)
+ webmock (1.8.11)
+ addressable (>= 2.2.7)
+ crack (>= 0.1.7)
+ yajl-ruby (1.1.0)
+ yard (0.8.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ appraisal
+ aruba (~> 0.4.11)
+ bundler (>= 1.0.7)
+ cucumber (~> 1.1.4)
+ curb (~> 0.8.0)
+ debugger
+ em-http-request (~> 1.0.2)
+ excon (>= 0.11.0, < 1.0)
+ fakeweb (~> 1.3.0)
+ faraday (~> 0.8)
+ fuubar
+ fuubar-cucumber
+ github-markup
+ httpclient (~> 2.2)
+ jruby-openssl
+ json (~> 1.6.5)
+ multi_json (~> 1.0.3)
+ patron (~> 0.4.15)
+ rack (~> 1.3.6)
+ rake (~> 0.9.2)
+ redcarpet (~> 1.17.2)
+ redis (~> 2.2.2)
+ relish (~> 0.6)
+ rspec (~> 2.11)
+ ruby-debug
+ shoulda (~> 2.9.2)
+ simplecov (~> 0.5.3)
+ sinatra (~> 1.3.2)
+ timecop (~> 0.3.5)
+ typhoeus (~> 0.4.2)
+ vcr!
+ webmock (= 1.8.11)
+ yajl-ruby (~> 1.1.0)
+ yard
37 spec/vcr/library_hooks/typhoeus_spec.rb
View
@@ -27,5 +27,42 @@ def directly_stub_request(method, url, response_body)
$typhoeus_after_loaded_hook.conditionally_invoke
end
end
+
+ context 'when there are nested hydra queues' do
+ def make_requests
+ VCR.use_cassette("nested") do
+ response_1 = response_2 = nil
+
+ hydra = Typhoeus::Hydra.new
+ request = Typhoeus::Request.new("http://localhost:#{VCR::SinatraApp.port}/")
+
+ request.on_success do |r1|
+ response_1 = r1
+
+ nested = Typhoeus::Request.new("http://localhost:#{VCR::SinatraApp.port}/foo")
+ nested.on_success { |r2| response_2 = r2 }
+
+ hydra.queue(nested)
+ end
+
+ hydra.queue(request)
+ hydra.run
+
+ return body_for(response_1), body_for(response_2)
+ end
+ end
+
+ def body_for(response)
+ return :no_response if response.nil?
+ response.body
+ end
+
+ it 'records and plays back properly' do
+ recorded = make_requests
+ played_back = make_requests
+
+ played_back.should eq(recorded)
+ end
+ end
end
2  vcr.gemspec
View
@@ -45,7 +45,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'patron', '~> 0.4.15'
s.add_development_dependency 'em-http-request', '~> 1.0.2'
s.add_development_dependency 'curb', '~> 0.8.0'
- s.add_development_dependency 'typhoeus', '~> 0.5'
+ s.add_development_dependency 'typhoeus', '~> 0.5.3'
s.add_development_dependency 'yajl-ruby', '~> 1.1.0'
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.