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

ruby-changes:17258

From: shyouhei <ko1@a...>
Date: Wed, 15 Sep 2010 15:01:10 +0900 (JST)
Subject: [ruby-changes:17258] Ruby:r29259 (trunk): * lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_nothing_raised):

shyouhei	2010-09-15 15:01:00 +0900 (Wed, 15 Sep 2010)

  New Revision: 29259

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

  Log:
    * lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_nothing_raised):
      should properly ignore MiniTest::Skip
    
    * lib/minitest/unit.rb (MiniTest::Assertions::assert_raises):
      ditto.
    
    * test/net/imap/test_imap.rb: Properly skip SSL tests when
      localhost is not 127.0.0.1.

  Modified files:
    trunk/ChangeLog
    trunk/lib/minitest/unit.rb
    trunk/lib/test/unit/assertions.rb
    trunk/test/net/imap/test_imap.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29258)
+++ ChangeLog	(revision 29259)
@@ -1,3 +1,14 @@
+Wed Sep 15 14:59:49 2010  URABE Shyouhei  <shyouhei@r...>
+
+	* lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_nothing_raised):
+	  should properly ignore MiniTest::Skip
+
+	* lib/minitest/unit.rb (MiniTest::Assertions::assert_raises):
+	  ditto.
+
+	* test/net/imap/test_imap.rb: Properly skip SSL tests when
+	  localhost is not 127.0.0.1.
+
 Wed Sep 15 13:37:00 2010  URABE Shyouhei  <shyouhei@r...>
 
 	* test/net/imap/test_imap.rb: "localhost" not guaranteed to
Index: lib/test/unit/assertions.rb
===================================================================
--- lib/test/unit/assertions.rb	(revision 29258)
+++ lib/test/unit/assertions.rb	(revision 29259)
@@ -32,6 +32,8 @@
         end
         begin
           line = __LINE__; yield
+        rescue MiniTest::Skip
+          raise
         rescue Exception => e
           bt = e.backtrace
           as = e.instance_of?(MiniTest::Assertion)
Index: lib/minitest/unit.rb
===================================================================
--- lib/minitest/unit.rb	(revision 29258)
+++ lib/minitest/unit.rb	(revision 29259)
@@ -222,6 +222,8 @@
       begin
         yield
         should_raise = true
+      rescue MiniTest::Skip
+        raise
       rescue Exception => e
         details = "#{msg}#{mu_pp(exp)} exception expected, not"
         assert(exp.any? { |ex|
Index: test/net/imap/test_imap.rb
===================================================================
--- test/net/imap/test_imap.rb	(revision 29258)
+++ test/net/imap/test_imap.rb	(revision 29259)
@@ -49,9 +49,13 @@
     if defined?(OpenSSL)
       assert_raise(OpenSSL::SSL::SSLError) do
         imaps_test do |port|
-          Net::IMAP.new("localhost",
-                        :port => port,
-                        :ssl => true)
+          begin
+            Net::IMAP.new("localhost",
+                          :port => port,
+                          :ssl => true)
+          rescue SystemCallError
+            skip $!
+          end
         end
       end
     end
@@ -61,9 +65,13 @@
     if defined?(OpenSSL)
       assert_nothing_raised do
         imaps_test do |port|
-          Net::IMAP.new("localhost",
-                        :port => port,
-                        :ssl => { :ca_file => CA_FILE })
+          begin
+            Net::IMAP.new("localhost",
+                          :port => port,
+                          :ssl => { :ca_file => CA_FILE })
+          rescue SystemCallError
+            skip $!
+          end
         end
       end
     end
@@ -104,6 +112,8 @@
         imap
       end
     end
+  rescue SystemCallError
+    skip $!
   ensure
     if imap && !imap.disconnected?
       imap.disconnect

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

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