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

ruby-changes:50927

From: nobu <ko1@a...>
Date: Thu, 12 Apr 2018 12:40:21 +0900 (JST)
Subject: [ruby-changes:50927] nobu:r63134 (trunk): marshaltestlib.rb: use clean object for exception

nobu	2018-04-12 12:40:16 +0900 (Thu, 12 Apr 2018)

  New Revision: 63134

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

  Log:
    marshaltestlib.rb: use clean object for exception
    
    * test/ruby/marshaltestlib.rb (test_exception): use separate
      clean object to raise an exception.  TestCase instance often has
      modules included.

  Modified files:
    trunk/test/ruby/marshaltestlib.rb
Index: test/ruby/marshaltestlib.rb
===================================================================
--- test/ruby/marshaltestlib.rb	(revision 63133)
+++ test/ruby/marshaltestlib.rb	(revision 63134)
@@ -110,7 +110,9 @@ module MarshalTestLib https://github.com/ruby/ruby/blob/trunk/test/ruby/marshaltestlib.rb#L110
   class MyException < Exception; def initialize(v, *args) super(*args); @v = v; end; attr_reader :v; end
   def test_exception
     marshal_equal(Exception.new('foo')) {|o| o.message}
-    marshal_equal(assert_raise(NoMethodError) {no_such_method()}) {|o| o.message}
+    obj = Object.new
+    e = assert_raise(NoMethodError) {obj.no_such_method()}
+    marshal_equal(e) {|o| o.message}
   end
 
   def test_exception_subclass

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

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