ruby-changes:56390
From: Nobuyoshi <ko1@a...>
Date: Mon, 8 Jul 2019 16:13:30 +0900 (JST)
Subject: [ruby-changes:56390] Nobuyoshi Nakada: e0a3c547dd (master): Get rid of toplevel methods
https://git.ruby-lang.org/ruby.git/commit/?id=e0a3c547dd From e0a3c547dd2690e5bfa4a03f59aed5315d926a82 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Mon, 8 Jul 2019 16:05:04 +0900 Subject: Get rid of toplevel methods diff --git a/test/win32ole/test_win32ole_event.rb b/test/win32ole/test_win32ole_event.rb index 0c819fc..d8e1625 100644 --- a/test/win32ole/test_win32ole_event.rb +++ b/test/win32ole/test_win32ole_event.rb @@ -5,8 +5,7 @@ rescue LoadError https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_event.rb#L5 end require 'test/unit' -def ado_installed? - installed = false +ado_installed = if defined?(WIN32OLE) db = nil begin @@ -15,24 +14,19 @@ def ado_installed? https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_event.rb#L14 db.open db.close db = nil - installed = true + true rescue end end - installed -end -def swbemsink_available? - available = false +swbemsink_available = if defined?(WIN32OLE) begin WIN32OLE.new('WbemScripting.SWbemSink') - available = true + true rescue end end - available -end if defined?(WIN32OLE_EVENT) class TestWIN32OLE_EVENT < Test::Unit::TestCase @@ -49,12 +43,8 @@ if defined?(WIN32OLE_EVENT) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_event.rb#L43 end end - class TestWIN32OLE_EVENT_SWbemSink < Test::Unit::TestCase - unless swbemsink_available? - def test_dummy_for_skip_message - skip "'WbemScripting.SWbemSink' is not available" - end - else + if swbemsink_available + class TestWIN32OLE_EVENT_SWbemSink < Test::Unit::TestCase def setup @wmi = WIN32OLE.connect('winmgmts://localhost/root/cimv2') @sws = WIN32OLE.new('WbemScripting.SWbemSink') @@ -166,12 +156,8 @@ if defined?(WIN32OLE_EVENT) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_event.rb#L156 end end - class TestWIN32OLE_EVENT_ADO < Test::Unit::TestCase - unless ado_installed? - def test_dummy_for_skip_message - skip "ActiveX Data Object Library not found" - end - else + if ado_installed + class TestWIN32OLE_EVENT_ADO < Test::Unit::TestCase CONNSTR="Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=.;" module ADO end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/