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

ruby-changes:54184

From: suke <ko1@a...>
Date: Sat, 15 Dec 2018 14:04:44 +0900 (JST)
Subject: [ruby-changes:54184] suke:r66405 (trunk): use System Monitor Control for spec of Win32OLE.

suke	2018-12-15 14:04:40 +0900 (Sat, 15 Dec 2018)

  New Revision: 66405

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

  Log:
    use System Monitor Control for spec of Win32OLE.
    
    * spec/ruby/library/win32ole/win32ole_method/event_interface_spec.rb:
      use System Monitor Control instead of Microsoft Internet Control

  Modified files:
    trunk/spec/ruby/library/win32ole/win32ole_method/event_interface_spec.rb
Index: spec/ruby/library/win32ole/win32ole_method/event_interface_spec.rb
===================================================================
--- spec/ruby/library/win32ole/win32ole_method/event_interface_spec.rb	(revision 66404)
+++ spec/ruby/library/win32ole/win32ole_method/event_interface_spec.rb	(revision 66405)
@@ -1,26 +1,28 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole_method/event_interface_spec.rb#L1
 platform_is :windows do
-  require 'win32ole'
+  require_relative '../fixtures/classes'
+  guard -> { WIN32OLESpecs::SYSTEM_MONITOR_CONTROL_AVAILABLE } do
 
-  describe "WIN32OLE_METHOD#event_interface" do
-    before :each do
-      ole_type = WIN32OLE_TYPE.new("Microsoft Internet Controls", "WebBrowser")
-      @navigate_method = WIN32OLE_METHOD.new(ole_type, "NavigateComplete")
-      ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "Shell")
-      @namespace_method = WIN32OLE_METHOD.new(ole_type, "namespace")
-    end
-
-    it "raises ArgumentError if argument is given" do
-      lambda { @navigate_method.event_interface(1) }.should raise_error ArgumentError
-    end
+    describe "WIN32OLE_METHOD#event_interface" do
+      before :each do
+        ole_type = WIN32OLE_TYPE.new("System Monitor Control", "SystemMonitor")
+        @on_dbl_click_method = WIN32OLE_METHOD.new(ole_type, "OnDblClick")
+        ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "Shell")
+        @namespace_method = WIN32OLE_METHOD.new(ole_type, "namespace")
+      end
+
+      it "raises ArgumentError if argument is given" do
+        lambda { @on_dbl_click_method.event_interface(1) }.should raise_error ArgumentError
+      end
+
+      it "returns expected string for System Monitor Control's 'OnDblClick' method" do
+        @on_dbl_click_method.event_interface.should == "DISystemMonitorEvents"
+      end
+
+      it "returns nil if method has no event interface" do
+        @namespace_method.event_interface.should be_nil
+      end
 
-    it "returns expected string for browser's 'NavigateComplete' method" do
-      @navigate_method.event_interface.should == "DWebBrowserEvents"
     end
-
-    it "returns nil if method has no event interface" do
-      @namespace_method.event_interface.should be_nil
-    end
-
   end
 
 end

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

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