summaryrefslogtreecommitdiff
path: root/test/open-uri/test_open-uri.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-21 14:15:04 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-21 14:15:04 +0000
commitbf287424fd00c0304c836525bb52d89fc1f4a84a (patch)
tree137fbb960f139d31ca13a8f6d5fd897db32ed808 /test/open-uri/test_open-uri.rb
parent7a54b5b4cea05369e6f3a3e85b7bb88a653ed472 (diff)
open-uri defines URI.open defined as an alias.
open-uri's Kernel.open will be deprecated in future. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/open-uri/test_open-uri.rb')
-rw-r--r--test/open-uri/test_open-uri.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/open-uri/test_open-uri.rb b/test/open-uri/test_open-uri.rb
index 3feed423a0..0301483902 100644
--- a/test/open-uri/test_open-uri.rb
+++ b/test/open-uri/test_open-uri.rb
@@ -68,6 +68,16 @@ class TestOpenURI < Test::Unit::TestCase
@proxies.each_with_index {|k, i| ENV[k] = @old_proxies[i] }
end
+ def test_200_uri_open
+ with_http {|srv, dr, url|
+ srv.mount_proc("/urifoo200", lambda { |req, res| res.body = "urifoo200" } )
+ URI.open("#{url}/urifoo200") {|f|
+ assert_equal("200", f.status[0])
+ assert_equal("urifoo200", f.read)
+ }
+ }
+ end
+
def test_200
with_http {|srv, dr, url|
srv.mount_proc("/foo200", lambda { |req, res| res.body = "foo200" } )