diff options
| author | Andrew Kane <andrew@ankane.org> | 2023-11-09 15:24:39 -0800 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-12-07 07:00:54 +0000 |
| commit | 41c00bc97ebf237fd04ce740d0dfd0681f4a28c7 (patch) | |
| tree | b083574be631f62055c5dc5de4020f72cf0301dc /test | |
| parent | d97479f9c966bd2c9d52c8be28aca9431760c610 (diff) | |
[ruby/open-uri] Set default for max_redirects and add exception class
https://github.com/ruby/open-uri/commit/dcdcb885cc
Diffstat (limited to 'test')
| -rw-r--r-- | test/open-uri/test_open-uri.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |
