Sha256: b5a9d4ea757a5fa4ac22c78f823851f803ba9e7217d0b0d9c91fb9a452d882cd
Contents?: true
Size: 1.11 KB
Versions: 3
Compression:
Stored size: 1.11 KB
Contents
require "helper" class TestRedirectLimitReached < MiniTest::Unit::TestCase def setup @agent = Mechanize.new end def test_to_s page = MechTestHelper.fake_page(@agent) error = Mechanize::RedirectLimitReachedError.new(page, 10) assert_match(/10/, error.to_s) end def test_get_default_redirects assert_raises(Mechanize::RedirectLimitReachedError) { begin @agent.get('http://localhost/infinite_redirect') rescue Mechanize::RedirectLimitReachedError => ex assert_equal(@agent.redirection_limit, ex.redirects) assert_equal("q=#{@agent.redirection_limit}", ex.page.uri.query) raise ex end } end def test_get_2_redirects @agent.redirection_limit = 2 assert_raises(Mechanize::RedirectLimitReachedError) { begin @agent.get('http://localhost/infinite_redirect') rescue Mechanize::RedirectLimitReachedError => ex assert_equal(2, ex.redirects) assert_equal(@agent.redirection_limit, ex.redirects) assert_equal("q=#{@agent.redirection_limit}", ex.page.uri.query) raise ex end } end end
Version data entries
3 entries across 3 versions & 3 rubygems
Version | Path |
---|---|
aai10-mechanize-2.0.1.0 | test/test_redirect_limit_reached.rb |
neocoin-mechanize-2.0.2 | test/test_redirect_limit_reached.rb |
mechanize-2.0.1 | test/test_redirect_limit_reached.rb |