aboutsummaryrefslogtreecommitdiffstats
path: root/test/net
diff options
context:
space:
mode:
authora_matsuda <a_matsuda@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-08 20:25:44 +0000
committera_matsuda <a_matsuda@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-08 20:25:44 +0000
commitfbd2e4827681d464e6f4c6c1392da7800c3d892a (patch)
tree0484ee089e95647d2ddc953dd4ccf1e09463ddbb /test/net
parentf1d558aa3ec9af80d841ce76b01261f22f8f0da6 (diff)
downloadruby-fbd2e4827681d464e6f4c6c1392da7800c3d892a.tar.gz
Fix undefined method 'dump' for nil:NilClass (NoMethodError)
Patch by: Dmitry Vorotilin <d.vorotilin@gmail.com> (@route) Signed-off-by: Akira Matsuda <ronnie@dio.jp> closes #1475 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r--test/net/http/test_httpresponse.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/net/http/test_httpresponse.rb b/test/net/http/test_httpresponse.rb
index a494b7fb85..a67add7c88 100644
--- a/test/net/http/test_httpresponse.rb
+++ b/test/net/http/test_httpresponse.rb
@@ -385,6 +385,22 @@ EOS
assert_equal(nil, res.message)
end
+ def test_raises_exception_with_missing_reason
+ io = dummy_io(<<EOS)
+HTTP/1.1 404
+Content-Length: 5
+Connection: close
+
+hello
+EOS
+
+ res = Net::HTTPResponse.read_new(io)
+ assert_equal(nil, res.message)
+ assert_raise Net::HTTPServerException do
+ res.error!
+ end
+ end
+
private
def dummy_io(str)