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

ruby-changes:39133

From: nobu <ko1@a...>
Date: Sat, 11 Jul 2015 08:48:11 +0900 (JST)
Subject: [ruby-changes:39133] nobu:r51214 (trunk): test_timeout.rb: add an assertion

nobu	2015-07-11 08:47:55 +0900 (Sat, 11 Jul 2015)

  New Revision: 51214

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

  Log:
    test_timeout.rb: add an assertion
    
    * test/test_timeout.rb (test_custom_exception): assert that the
      given exception will raise on timeout.

  Modified files:
    trunk/test/test_timeout.rb
Index: test/test_timeout.rb
===================================================================
--- test/test_timeout.rb	(revision 51213)
+++ test/test_timeout.rb	(revision 51214)
@@ -60,6 +60,11 @@ class TestTimeout < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/test_timeout.rb#L60
     assert_nothing_raised(ArgumentError, bug9354) do
       assert_equal(:ok, timeout(100, err) {:ok})
     end
+    assert_raise_with_message(err, /execution expired/) do
+      timeout 0.01, err do
+        sleep 3
+      end
+    end
   end
 
   def test_exit_exception

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

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