ruby-changes:32662
From: usa <ko1@a...>
Date: Wed, 29 Jan 2014 13:50:21 +0900 (JST)
Subject: [ruby-changes:32662] usa:r44741 (ruby_1_9_3): merge revision(s) 43954: [Backport #9125]
usa 2014-01-29 13:50:16 +0900 (Wed, 29 Jan 2014) New Revision: 44741 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44741 Log: 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. Modified directories: branches/ruby_1_9_3/ Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/lib/net/smtp.rb branches/ruby_1_9_3/test/net/smtp/test_smtp.rb branches/ruby_1_9_3/version.h Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 44740) +++ ruby_1_9_3/ChangeLog (revision 44741) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1 +Wed Jan 29 13:40:48 2014 Eric Hodel <drbrain@s...> + + * 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. + Wed Jan 29 13:32:53 2014 Nobuyoshi Nakada <nobu@r...> * eval_jump.c (rb_exec_end_proc): unlink and free procs data before Index: ruby_1_9_3/lib/net/smtp.rb =================================================================== --- ruby_1_9_3/lib/net/smtp.rb (revision 44740) +++ ruby_1_9_3/lib/net/smtp.rb (revision 44741) @@ -934,11 +934,11 @@ module Net https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/net/smtp.rb#L934 end def critical(&block) - return '200 dummy reply code' if @error_occured + return Response.parse('200 dummy reply code') if @error_occurred begin return yield() rescue Exception - @error_occured = true + @error_occurred = true raise end end Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 44740) +++ ruby_1_9_3/version.h (revision 44741) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1 #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 495 +#define RUBY_PATCHLEVEL 496 #define RUBY_RELEASE_DATE "2014-01-29" #define RUBY_RELEASE_YEAR 2014 Index: ruby_1_9_3/test/net/smtp/test_smtp.rb =================================================================== --- ruby_1_9_3/test/net/smtp/test_smtp.rb (revision 44740) +++ ruby_1_9_3/test/net/smtp/test_smtp.rb (revision 44741) @@ -3,6 +3,19 @@ require 'minitest/autorun' https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/test/net/smtp/test_smtp.rb#L3 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 Property changes on: ruby_1_9_3 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r43954 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/