Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add spec for excon's streaming API.

  • Loading branch information...
commit 00f50c26599c35a173fa2ee17e0adeacc7f6637d 1 parent 2659fd5
Myron Marston authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 spec/vcr/http_stubbing_adapters/excon_spec.rb
20 spec/vcr/http_stubbing_adapters/excon_spec.rb
View
@@ -35,5 +35,25 @@
recorded.should == 'query: Tolkien'
end
end
+
+ context "when Excon's streaming API is used" do
+ it 'properly records and plays back the response' do
+ described_class.http_connections_allowed = true
+ recorded, played_back = [1, 2].map do
+ chunks = []
+
+ VCR.use_cassette('excon_streaming', :record => :once) do
+ Excon.get("http://localhost:#{VCR::SinatraApp.port}/foo") do |chunk, remaining_bytes, total_bytes|
+ chunks << chunk
+ end
+ end
+
+ chunks.join
+ end
+
+ recorded.should == played_back
+ recorded.should == "FOO!"
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.