You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2013/09/22 03:46:19 UTC
svn commit: r1525312 - /buildr/trunk/spec/core/transport_spec.rb
Author: donaldp
Date: Sun Sep 22 01:46:18 2013
New Revision: 1525312
URL: http://svn.apache.org/r1525312
Log:
Update the tests to ensure cache control headers are tested
Modified:
buildr/trunk/spec/core/transport_spec.rb
Modified: buildr/trunk/spec/core/transport_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/core/transport_spec.rb?rev=1525312&r1=1525311&r2=1525312&view=diff
==============================================================================
--- buildr/trunk/spec/core/transport_spec.rb (original)
+++ buildr/trunk/spec/core/transport_spec.rb Sun Sep 22 01:46:18 2013
@@ -328,7 +328,7 @@ describe URI::HTTP, '#read' do
redirect['Location'] = "http://#{@host_domain}/asdf"
request1 = mock('request1')
- Net::HTTP::Get.should_receive(:new).once.with('/', nil).and_return(request1)
+ Net::HTTP::Get.should_receive(:new).once.with('/', {"Cache-Control"=>"no-cache"}).and_return(request1)
request1.should_receive(:basic_auth).with('john', 'secret')
@http.should_receive(:request).with(request1).and_yield(redirect)
@@ -337,7 +337,7 @@ describe URI::HTTP, '#read' do
ok.stub!(:read_body)
request2 = mock('request2')
- Net::HTTP::Get.should_receive(:new).once.with("/asdf", nil).and_return(request2)
+ Net::HTTP::Get.should_receive(:new).once.with("/asdf", {"Cache-Control"=>"no-cache"}).and_return(request2)
request2.should_receive(:basic_auth).with('john', 'secret')
@http.should_receive(:request).with(request2).and_yield(ok)
@@ -347,7 +347,7 @@ describe URI::HTTP, '#read' do
it 'should include the query part when performing HTTP GET' do
# should this test be generalized or shared with any other URI subtypes?
Net::HTTP.stub!(:new).and_return(@http)
- Net::HTTP::Get.should_receive(:new).with(/#{Regexp.escape(@query)}$/, nil)
+ Net::HTTP::Get.should_receive(:new).with(/#{Regexp.escape(@query)}$/, {"Cache-Control"=>"no-cache"})
@uri.read
end