ruby-changes:53034
From: suke <ko1@a...>
Date: Sat, 20 Oct 2018 22:16:30 +0900 (JST)
Subject: [ruby-changes:53034] suke:r65248 (trunk): refactoring. suppress warning.
suke 2018-10-20 22:16:25 +0900 (Sat, 20 Oct 2018) New Revision: 65248 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65248 Log: refactoring. suppress warning. * test/win32ole/test_win32ole_record.rb: refactoring. suppress warning. Modified files: trunk/test/win32ole/test_win32ole_record.rb Index: test/win32ole/test_win32ole_record.rb =================================================================== --- test/win32ole/test_win32ole_record.rb (revision 65247) +++ test/win32ole/test_win32ole_record.rb (revision 65248) @@ -67,14 +67,10 @@ End Class https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_record.rb#L67 if defined?(WIN32OLE_RECORD) def rbcomtest_exist? - exist = false - begin - obj = WIN32OLE.new(PROGID_RBCOMTEST) - exist = true - rescue WIN32OLERuntimeError - exist = false - end - exist + WIN32OLE.new(PROGID_RBCOMTEST) + true + rescue WIN32OLERuntimeError + false end class TestWIN32OLE_RECORD_BY_RBCOMTEST < Test::Unit::TestCase @@ -102,13 +98,13 @@ if defined?(WIN32OLE_RECORD) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_record.rb#L98 def test_s_new_raise assert_raise(WIN32OLERuntimeError) { - rec = WIN32OLE_RECORD.new('NonExistRecordName', @obj) + WIN32OLE_RECORD.new('NonExistRecordName', @obj) } assert_raise(ArgumentError) { - rec = WIN32OLE_RECORD.new + WIN32OLE_RECORD.new } assert_raise(ArgumentError) { - rec = WIN32OLE_RECORD.new('NonExistRecordName') + WIN32OLE_RECORD.new('NonExistRecordName') } end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/