Sha256: a10beed7000509becd6a89f078a4ba8ef02d8ed15d465855afd3ee712a7fb3ae

Contents?: true

Size: 736 Bytes

Versions: 3

Compression:

Stored size: 736 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper'

require 'webrick'
require 'webrick/httpproxy'

# Test cases for the ProxyTests.
class ProxyTests < Test::Unit::TestCase
  include W3CValidators

  def setup
    @ps = WEBrick::HTTPProxyServer.new(:Port => 9999, :ServerType => Thread, :RequestCallback => Proc.new{|req,res| puts req.request_line, req.raw_header})
  
    ['TERM', 'INT'].each do |signal|
      trap(signal){ @ps.shutdown }
    end

    @ps.start

    @v = MarkupValidator.new({:proxy_server => 'localhost', :proxy_port => 9999})
    sleep 1
  end


  def test_validating_uri_with_head_request
    r = @v.validate_uri_quickly('http://code.dunae.ca/w3c_validators/test/invalid_markup.html')
    assert_errors r, 1
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
w3c_validators-1.1.1 test/test_proxy.rb
w3c_validators-1.1 test/test_proxy.rb
w3c_validators-1.0.2 test/test_proxy.rb