[前][次][番号順一覧][スレッド一覧]

ruby-changes:32314

From: nagachika <ko1@a...>
Date: Wed, 25 Dec 2013 01:21:45 +0900 (JST)
Subject: [ruby-changes:32314] nagachika:r44393 (ruby_2_0_0): merge revision(s) 43954: [Backport #9125]

nagachika	2013-12-25 01:21:37 +0900 (Wed, 25 Dec 2013)

  New Revision: 44393

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44393

  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_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/lib/net/smtp.rb
    branches/ruby_2_0_0/test/net/smtp/test_smtp.rb
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 44392)
+++ ruby_2_0_0/ChangeLog	(revision 44393)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Wed Dec 25 00:46:44 2013  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 Dec 25 00:18:19 2013  Tanaka Akira  <akr@f...>
 
 	* ext/socket/lib/socket.rb: Don't test $! in "ensure" clause because
Index: ruby_2_0_0/lib/net/smtp.rb
===================================================================
--- ruby_2_0_0/lib/net/smtp.rb	(revision 44392)
+++ ruby_2_0_0/lib/net/smtp.rb	(revision 44393)
@@ -936,7 +936,7 @@ module Net https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/net/smtp.rb#L936
     end
 
     def critical
-      return '200 dummy reply code' if @error_occurred
+      return Response.parse('200 dummy reply code') if @error_occurred
       begin
         return yield()
       rescue Exception
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 44392)
+++ ruby_2_0_0/version.h	(revision 44393)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2013-12-25"
-#define RUBY_PATCHLEVEL 375
+#define RUBY_PATCHLEVEL 376
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 12
Index: ruby_2_0_0/test/net/smtp/test_smtp.rb
===================================================================
--- ruby_2_0_0/test/net/smtp/test_smtp.rb	(revision 44392)
+++ ruby_2_0_0/test/net/smtp/test_smtp.rb	(revision 44393)
@@ -3,6 +3,19 @@ require 'minitest/autorun' https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/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_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r43954


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]