Sha256: 63b0fd3fa0dfab694966fc2c54514f36eceffde4dc701c0d6b39c6080f87bbca

Contents?: true

Size: 752 Bytes

Versions: 6

Compression:

Stored size: 752 Bytes

Contents

require File.expand_path('test_helper', File.dirname(__FILE__))

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

6 entries across 6 versions & 2 rubygems

Version Path
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/w3c_validators-1.2/test/test_proxy.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/w3c_validators-1.2/test/test_proxy.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/w3c_validators-1.2/test/test_proxy.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/w3c_validators-1.2/test/test_proxy.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/w3c_validators-1.2/test/test_proxy.rb
w3c_validators-1.2 test/test_proxy.rb