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

ruby-changes:6805

From: suke <ko1@a...>
Date: Sat, 2 Aug 2008 23:00:00 +0900 (JST)
Subject: [ruby-changes:6805] Ruby:r18321 (trunk): * test/win32ole/test_err_in_callback.rb: remove temporary files.

suke	2008-08-02 22:59:43 +0900 (Sat, 02 Aug 2008)

  New Revision: 18321

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

  Log:
    * test/win32ole/test_err_in_callback.rb: remove temporary files.
      some refactoring.

  Modified files:
    trunk/ChangeLog
    trunk/test/win32ole/test_err_in_callback.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 18320)
+++ ChangeLog	(revision 18321)
@@ -1,3 +1,8 @@
+Sat Aug  2 22:55:41 2008  Masaki Suketa  <masaki.suketa@n...>
+
+	* test/win32ole/test_err_in_callback.rb: remove temporary files.
+	  some refactoring.
+
 Sat Aug  2 15:51:50 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (yylex): 8 and 9 in octal integer should cause compile
Index: test/win32ole/test_err_in_callback.rb
===================================================================
--- test/win32ole/test_err_in_callback.rb	(revision 18320)
+++ test/win32ole/test_err_in_callback.rb	(revision 18321)
@@ -15,7 +15,8 @@
     def setup
       @ruby = nil
       if File.exist?("./" + CONFIG["RUBY_INSTALL_NAME"] + CONFIG["EXEEXT"])
-        @ruby = "./" + CONFIG["RUBY_INSTALL_NAME"]
+        sep = File::ALT_SEPARATOR || "/"
+        @ruby = "." + sep + CONFIG["RUBY_INSTALL_NAME"]
         @iopt = $:.map {|e|
           " -I " + e
         }.join("")
@@ -33,14 +34,20 @@
       f = cfolder.CreateTextFile(dummy_file)
       f.writeLine("<html><body><div id='str'>#{@str}</div></body></html>")
       f.close
+      @f = dummy_file
       dummy_path = cfolder.path + "\\" + dummy_file
       dummy_path
     end
 
     def test_err_in_callback
       if @ruby
-        r = `#{@ruby} #{@iopt} #{@script} #{@param}`
-        assert_match(/NameError/, r)
+        cmd = "#{@ruby} -v #{@iopt} #{@script} #{@param} > test_err_in_callback.log 2>&1"
+        system(cmd)
+        str = ""
+        open("test_err_in_callback.log") {|ifs|
+          str = ifs.read
+        }
+        assert_match(/NameError/, str)
       end
     end
 
@@ -68,6 +75,8 @@
     def teardown
       WIN32OLE_EVENT.message_loop
       ie_quit
+      File.unlink(@f)
+      File.unlink("test_err_in_callback.log")
     end
   end
 end

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

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