From 41c00bc97ebf237fd04ce740d0dfd0681f4a28c7 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 9 Nov 2023 15:24:39 -0800 Subject: [ruby/open-uri] Set default for max_redirects and add exception class https://github.com/ruby/open-uri/commit/dcdcb885cc --- test/open-uri/test_open-uri.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/open-uri/test_open-uri.rb b/test/open-uri/test_open-uri.rb index 6bad7f4bdf..30e3b5c9c1 100644 --- a/test/open-uri/test_open-uri.rb +++ b/test/open-uri/test_open-uri.rb @@ -572,7 +572,7 @@ class TestOpenURI < Test::Unit::TestCase srv.mount_proc("/r1/") {|req, res| res.status = 301; res["location"] = "#{url}/r2"; res.body = "r1" } srv.mount_proc("/r2/") {|req, res| res.status = 301; res["location"] = "#{url}/r3"; res.body = "r2" } srv.mount_proc("/r3/") {|req, res| res.body = "r3" } - exc = assert_raise(RuntimeError) { URI.open("#{url}/r1/", max_redirects: 1) {} } + exc = assert_raise(OpenURI::TooManyRedirects) { URI.open("#{url}/r1/", max_redirects: 1) {} } assert_equal("Too many redirects", exc.message) } end -- cgit v1.2.3