~javier-lopez/ubuntu/vivid/ruby1.9.1/fix-1426828

« back to all changes in this revision

Viewing changes to test/net/http/utils.rb

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2013-11-25 09:59:41 UTC
  • mfrom: (21.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20131125095941-aou3ymnwm79em09y
Tags: 1.9.3.448-1ubuntu1
* Merge from Debian. Remaining changes:
  - debian/control: Add ca-certificates to libruby1.9.1 depends so that
    rubygems can perform certificate verification
  - debian/rules: Don't install SSL certificates from upstream sources
  - debian/patches/20120927-rubygems_disable_upstream_certs.patch: Use
    /etc/ssl/certs/ca-certificates.crt for the trusted CA certificates.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
  end
20
20
 
21
21
  def config(key)
22
 
    self.class::CONFIG[key]
 
22
    @config ||= self.class::CONFIG
 
23
    @config[key]
23
24
  end
24
25
 
25
26
  def logfile
42
43
  end
43
44
 
44
45
  def spawn_server
 
46
    @config = self.class::CONFIG
45
47
    server_config = {
46
48
      :BindAddress => config('host'),
47
49
      :Port => config('port'),
61
63
    @server = WEBrick::HTTPServer.new(server_config)
62
64
    @server.mount('/', Servlet, config('chunked'))
63
65
    @server.start
 
66
    @config['port'] = @server[:Port] if @config['port'] == 0
64
67
    n_try_max = 5
65
68
    begin
66
69
      TCPSocket.open(config('host'), config('port')).close