test/testhelp.rb in mongrel-1.0.1 vs test/testhelp.rb in mongrel-1.0.2
- old
+ new
@@ -2,10 +2,35 @@
# You can redistribute it and/or modify it under the same terms as Ruby.
#
# Additional work donated by contributors. See http://mongrel.rubyforge.org/attributions.html
# for more information.
+
+HERE = File.dirname(__FILE__)
+%w(lib ext bin test).each do |dir|
+ $LOAD_PATH.unshift "#{HERE}/../#{dir}"
+end
+
+require 'rubygems'
+require 'test/unit'
+require 'net/http'
+require 'timeout'
+require 'cgi/session'
+require 'fileutils'
+require 'benchmark'
+require 'digest/sha1'
+require 'uri'
+require 'stringio'
+
+require 'mongrel'
+require 'mongrel/stats'
+
+if ENV['DEBUG']
+ require 'ruby-debug'
+ Debugger.start
+end
+
def redirect_test_io
orig_err = STDERR.dup
orig_out = STDOUT.dup
STDERR.reopen("test_stderr.log")
STDOUT.reopen("test_stdout.log")
@@ -15,12 +40,11 @@
ensure
STDERR.reopen(orig_err)
STDOUT.reopen(orig_out)
end
end
-
-
+
# 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|
@@ -37,6 +61,5 @@
results << res
end
return results
end
-