Sha256: 7c2d100d50ff99c7227f269ebe2f8a7c96adc35ba206897e7896ff74499b88f1

Contents?: true

Size: 535 Bytes

Versions: 9

Compression:

Stored size: 535 Bytes

Contents

require_relative 'helper'

class TestRespondWithStatusCode < Test::Unit::TestCase

  include ARProxyTest

  def test_respond_with_500
    @ar.add_rule 'http://www.163.com/' => 500
    @req.start('www.163.com') do |http|
      http.request_get('/') do |res|
        assert_equal "500", res.code
      end
    end
  end

  def test_respond_with_404
    @ar.add_rule 'http://www.163.com' => 404
    @req.start('www.163.com') do |http|
      http.request_get('/') do |res|
        assert_equal "404", res.code
      end
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
auto_response-0.2.0 test/respond_with_number_test.rb
auto_response-0.1.8 test/respond_with_number_test.rb
auto_response-0.1.6 test/respond_with_number_test.rb
auto_response-0.1.5 test/respond_with_number_test.rb
auto_response-0.1.4 test/respond_with_number_test.rb
auto_response-0.1.3 test/respond_with_number_test.rb
auto_response-0.1.2 test/respond_with_number_test.rb
auto_response-0.1.1 test/respond_with_number_test.rb
auto_response-0.1.0 test/respond_with_number_test.rb