Sha256: 94f97c56b19d2b83de8b607090cb6e08944894e97a5008869969fec5729feedb

Contents?: true

Size: 560 Bytes

Versions: 2

Compression:

Stored size: 560 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))

class TestResponseReader < Test::Unit::TestCase
  def test_handle_bad_response_code
    response = Object.new
    class << response
      def read_body
      end
      def code; 999; end
    end

    v = Mechanize::Chain.new([
      Mechanize::Chain::ResponseReader.new(response)
    ])
    assert_raises(Mechanize::ResponseCodeError) {
      begin
        v.handle({})
      rescue Exception => x
        assert_equal(999, x.response_code)
        raise x
      end
    }
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
kitamomonga-mechanize-0.9.3.20090724215219 test/chain/test_response_reader.rb
tenderlove-mechanize-0.9.3.20090911221705 test/chain/test_response_reader.rb