From 46048d6d1b629ddb5f1bef36ad27229bc8d8e7f9 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 20 Mar 2013 06:24:14 +0000 Subject: * test/win32ole/test_err_in_callback.rb (TestErrInCallBack#setup): use relative path to get rid of "too long commandline" error. * ChangeLog: fixed wrong description. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/win32ole/test_err_in_callback.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/win32ole') diff --git a/test/win32ole/test_err_in_callback.rb b/test/win32ole/test_err_in_callback.rb index 395173d82c..9a430089fb 100644 --- a/test/win32ole/test_err_in_callback.rb +++ b/test/win32ole/test_err_in_callback.rb @@ -9,6 +9,7 @@ rescue LoadError end if defined?(WIN32OLE) require 'mkmf' + require 'pathname' require 'test/unit' require 'tmpdir' class TestErrInCallBack < Test::Unit::TestCase @@ -17,10 +18,11 @@ if defined?(WIN32OLE) if File.exist?("./" + CONFIG["RUBY_INSTALL_NAME"] + CONFIG["EXEEXT"]) sep = File::ALT_SEPARATOR || "/" @ruby = "." + sep + CONFIG["RUBY_INSTALL_NAME"] + cwd = Pathname.new(File.expand_path('.')) @iopt = $:.map {|e| - " -I " + e + " -I " + Pathname.new(e).relative_path_from(cwd).to_s }.join("") - @script = File.join(File.dirname(__FILE__), "err_in_callback.rb") + @script = Pathname.new(File.join(File.dirname(__FILE__), "err_in_callback.rb")).relative_path_from(cwd).to_s end end @@ -39,7 +41,7 @@ if defined?(WIN32OLE) Dir.mktmpdir do |tmpdir| logfile = File.join(tmpdir, "test_err_in_callback.log") cmd = "#{@ruby} -v #{@iopt} #{@script} > #{logfile.gsub(%r(/), '\\')} 2>&1" - system(cmd) + result = system(cmd) str = "" open(logfile) {|ifs| str = ifs.read -- cgit v1.2.3