public
Rubygem
Description: Apache Buildr
Homepage: http://incubator.apache.org/buildr
Clone URL: git://github.com/vic/buildr.git
Search Repo:
Merge branch 'BUILDR-67'


git-svn-id: https://svn.apache.org/repos/asf/incubator/buildr/trunk@654151 
13f79535-47bb-0310-9956-ffa450edef68
Assaf (author)
Wed May 07 08:38:11 -0700 2008
commit  31abc5e668afa322f5ca04b47e78add3f7e03125
tree    9c99fc5733d10e50f59166dfd1042348f7dd6bb7
parent  23d85f86e473e2339ef436f60e44a40403936543
...
299
300
301
302
 
303
304
305
...
299
300
301
 
302
303
304
305
0
@@ -299,7 +299,7 @@
0
       http.use_ssl = true if self.instance_of? URI::HTTPS
0
 
0
       puts "Requesting #{self}" if Buildr.application.options.trace
0
- request = Net::HTTP::Get.new(path.empty? ? '/' : path, headers)
0
+ request = Net::HTTP::Get.new(request_uri.empty? ? '/' : request_uri, headers)
0
       request.basic_auth self.user, self.password if self.user
0
       http.request request do |response|
0
         case response
...
221
222
223
224
 
 
 
225
226
227
...
297
298
299
 
 
 
 
 
 
 
 
300
301
302
...
221
222
223
 
224
225
226
227
228
229
...
299
300
301
302
303
304
305
306
307
308
309
310
311
312
0
@@ -221,7 +221,9 @@
0
     @proxy = 'http://john:smith@myproxy:8080'
0
     @domain = 'domain'
0
     @host_domain = "host.#{@domain}"
0
- @uri = URI("http://#{@host_domain}")
0
+ @path = "/foo/bar/baz"
0
+ @query = "?query"
0
+ @uri = URI("http://#{@host_domain}#{@path}#{@query}")
0
     @no_proxy_args = [@host_domain, 80]
0
     @proxy_args = @no_proxy_args + ['myproxy', 8080, 'john', 'smith']
0
     @http = mock('http')
0
@@ -297,6 +299,14 @@
0
     request.should_receive(:basic_auth).with('john', 'secret')
0
     URI("http://john:secret@#{@host_domain}").read
0
   end
0
+
0
+ it 'should include the query part when performing HTTP GET' do
0
+ # should this test be generalized or shared with any other URI subtypes?
0
+ Net::HTTP.stub!(:new).and_return(@http)
0
+ Net::HTTP::Get.should_receive(:new).with(/#{Regexp.escape(@query)}$/, nil)
0
+ @uri.read
0
+ end
0
+
0
 end
0
 
0
 

Comments

    No one has commented yet.