Sha256: 414c7bc0d60d6eb1db61952559fd9cded60ff879df9131df58924509371c2340

Contents?: true

Size: 837 Bytes

Versions: 15

Compression:

Stored size: 837 Bytes

Contents

# Copyright (c) 2011 Evan Phoenix
# Copyright (c) 2005 Zed A. Shaw 


%w(lib test).each do |d|
  dir = File.expand_path("../../#{d}", __FILE__)
  $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
end

require 'rubygems'
require 'test/unit'
require 'net/http'
require 'digest/sha1'
require 'uri'
require 'stringio'

require 'puma'

# Either takes a string to do a get request against, or a tuple of [URI, HTTP] where
# HTTP is some kind of Net::HTTP request object (POST, HEAD, etc.)
def hit(uris)
  results = []
  uris.each do |u|
    res = nil

    if u.kind_of? String
      res = Net::HTTP.get(URI.parse(u))
    else
      url = URI.parse(u[0])
      res = Net::HTTP.new(url.host, url.port).start {|h| h.request(u[1]) }
    end

    assert res != nil, "Didn't get a response: #{u}"
    results << res
  end

  return results
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
puma-2.0.0.b2-java test/testhelp.rb
puma-2.0.0.b2 test/testhelp.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/puma-1.6.3/test/testhelp.rb
puma-2.0.0.b1-java test/testhelp.rb
puma-2.0.0.b1 test/testhelp.rb
puma-1.6.3-java test/testhelp.rb
puma-1.6.3 test/testhelp.rb
puma-1.6.2-java test/testhelp.rb
puma-1.6.2 test/testhelp.rb
puma-1.6.1-java test/testhelp.rb
puma-1.6.1 test/testhelp.rb
puma-1.6.0-java test/testhelp.rb
puma-1.6.0 test/testhelp.rb
puma-1.5.0-java test/testhelp.rb
puma-1.5.0 test/testhelp.rb