diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-02 05:18:04 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-02 05:18:04 +0000 |
commit | 34e57abf23ac9695ee67f64e33b6ddd85a88e7f6 (patch) | |
tree | 5188a551c1b38328aff1315431491a185892b423 /test/net/smtp | |
parent | 673efdceef8ab206b4220dcbf5beb2df3dd2fa66 (diff) | |
download | ruby-34e57abf23ac9695ee67f64e33b6ddd85a88e7f6.tar.gz |
* 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/trunk@43954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net/smtp')
-rw-r--r-- | test/net/smtp/test_smtp.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/net/smtp/test_smtp.rb b/test/net/smtp/test_smtp.rb index 0b8d657559..748b20d65b 100644 --- a/test/net/smtp/test_smtp.rb +++ b/test/net/smtp/test_smtp.rb @@ -21,6 +21,19 @@ module Net end end + 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 |