summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-29 04:50:16 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-29 04:50:16 +0000
commit54bd3c23fb8d218b3c551da89d040bf9544eae9a (patch)
tree248411caaf5d5e8468b7ca18b1f54d0b237f2b53 /test
parent1e6eed0cf5a45a787e01630b10d1f3f87e7a01d3 (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_1_9_3@44741 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