summaryrefslogtreecommitdiff
path: root/test/open-uri
diff options
context:
space:
mode:
Diffstat (limited to 'test/open-uri')
-rw-r--r--test/open-uri/test_ftp.rb4
-rw-r--r--test/open-uri/test_open-uri.rb2
-rw-r--r--test/open-uri/test_proxy.rb4
3 files changed, 6 insertions, 4 deletions
diff --git a/test/open-uri/test_ftp.rb b/test/open-uri/test_ftp.rb
index 9698ff2777..0b3bafb9e0 100644
--- a/test/open-uri/test_ftp.rb
+++ b/test/open-uri/test_ftp.rb
@@ -8,10 +8,10 @@ class TestOpenURIFtp < Test::Unit::TestCase
begin
old = {}
h.each_key {|k| old[k] = ENV[k] }
- h.each {|k, v| ENV[k] = v }
+ ENV.update(h)
yield
ensure
- h.each_key {|k| ENV[k] = old[k] }
+ ENV.update(old)
end
end
diff --git a/test/open-uri/test_open-uri.rb b/test/open-uri/test_open-uri.rb
index 0679180ce9..6f08b4089c 100644
--- a/test/open-uri/test_open-uri.rb
+++ b/test/open-uri/test_open-uri.rb
@@ -80,6 +80,8 @@ class TestOpenURI < Test::Unit::TestCase
sock.print "Content-Length: 4\r\n\r\n"
sleep 1
sock.print "ab\r\n"
+ rescue Errno::EPIPE, Errno::ECONNRESET, Errno::ECONNABORTED
+ # expected when client times out and closes the connection
ensure
sock.close
end
diff --git a/test/open-uri/test_proxy.rb b/test/open-uri/test_proxy.rb
index a36a63f21f..0cc711a0f3 100644
--- a/test/open-uri/test_proxy.rb
+++ b/test/open-uri/test_proxy.rb
@@ -11,10 +11,10 @@ class TestOpenURIProxy < Test::Unit::TestCase
begin
old = {}
h.each_key {|k| old[k] = ENV[k] }
- h.each {|k, v| ENV[k] = v }
+ ENV.update(h)
yield
ensure
- h.each_key {|k| ENV[k] = old[k] }
+ ENV.update(old)
end
end