test/test_http.rb in atom-tools-2.0.1 vs test/test_http.rb in atom-tools-2.0.2

- old
+ new

@@ -22,11 +22,11 @@ end def test_parse_wwwauth # a Basic WWW-Authenticate header = 'realm="SokEvo"' - + params = @http.send :parse_quoted_wwwauth, header assert_equal "SokEvo", params[:realm] # Digest is parsed a bit differently header = 'opaque="07UrfUiCYac5BbWJ", algorithm=MD5-sess, qop="auth", stale=TRUE, nonce="MDAx0Mzk", realm="test authentication"' @@ -270,33 +270,10 @@ @http.pass = PASS assert_authenticates end - def test_https - require 'webrick/https' - - @s = WEBrick::HTTPServer.new( - :Port => (@port + 1), - :DocumentRoot => Dir::pwd + "/htdocs", - :Logger => WEBrick::Log.new($stderr, WEBrick::Log::FATAL), - :AccessLog => [], - :SSLEnable => true, - :SSLVerifyClient => ::OpenSSL::SSL::VERIFY_NONE, - :SSLCertName => [ ["C","CA"], ["O","localhost"], ["CN", "WWW"] ] - ) - - mount_one_shot do |req,res| - res.body = SECRET_DATA - end - - res = @http.get("https://localhost:#{@port + 1}/") - - assert_equal "200", res.code - assert_equal SECRET_DATA, res.body - end - # mount a block on the test server, shutting the server down after a # single request def mount_one_shot &block @s.mount_proc("/") do |req,res| block.call req, res @@ -307,11 +284,11 @@ end # test that we authenticated properly def assert_authenticates get_root - assert_equal "200", @res.code - assert_equal SECRET_DATA, @res.body + assert_equal "200", @res.code + assert_equal SECRET_DATA, @res.body end # performs a GET on the test server def get_root(*args) @res = @http.get("http://localhost:#{@port}/", *args)