summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-24 16:21:37 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-24 16:21:37 +0000
commit38bbe3741dc592c0835b71aed1955f8b18c6e5e2 (patch)
tree9c771abfb2a46b68cd4bf4cd2cce12d7da31ef9e /test
parentbcef849df94fc48bd9c99472303f2fb7cf251f17 (diff)
merge revision(s) 43954: [Backport #9125]
* lib/net/smtp.rb (Net::SMTP#critical): Always return a Net::SMTP::Response. Patch by Pawel Veselov. [ruby-trunk - Bug #9125] * test/net/smtp/test_smtp.rb: Test for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@44393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/net/smtp/test_smtp.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/net/smtp/test_smtp.rb b/test/net/smtp/test_smtp.rb
index 8af6a37d53..ba2943db56 100644
--- a/test/net/smtp/test_smtp.rb
+++ b/test/net/smtp/test_smtp.rb
@@ -3,6 +3,19 @@ require 'minitest/autorun'
module Net
class TestSMTP < MiniTest::Unit::TestCase
+ def test_critical
+ smtp = Net::SMTP.new 'localhost', 25
+
+ assert_raises RuntimeError do
+ smtp.send :critical do
+ raise 'fail on purpose'
+ end
+ end
+
+ assert_kind_of Net::SMTP::Response, smtp.send(:critical),
+ '[Bug #9125]'
+ end
+
def test_esmtp
smtp = Net::SMTP.new 'localhost', 25
assert smtp.esmtp