summaryrefslogtreecommitdiff
path: root/test/win32ole
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-20 06:24:14 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-20 06:24:14 +0000
commit46048d6d1b629ddb5f1bef36ad27229bc8d8e7f9 (patch)
tree9f0d5956e896f95f28a99e221896ca01d5975298 /test/win32ole
parent119aa9d295cc779fbf6d5af1ac899d8371ea3816 (diff)
* 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
Diffstat (limited to 'test/win32ole')
-rw-r--r--test/win32ole/test_err_in_callback.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/win32ole/test_err_in_callback.rb b/test/win32ole/test_err_in_callback.rb
index 395173d..9a43008 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