diff options
author | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-02 13:59:43 +0000 |
---|---|---|
committer | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-02 13:59:43 +0000 |
commit | 9b47469a25939ec7071621cc6dffbe38a28e4710 (patch) | |
tree | 14bc95119b69ff1a31ccba245d4a6dc49ad14a17 /test | |
parent | 142a7a03e19180c93d43974151449eaf5d1f9647 (diff) | |
download | ruby-9b47469a25939ec7071621cc6dffbe38a28e4710.tar.gz |
* test/win32ole/test_err_in_callback.rb: remove temporary files.
some refactoring.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/win32ole/test_err_in_callback.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/test/win32ole/test_err_in_callback.rb b/test/win32ole/test_err_in_callback.rb index 38bb66dcf0..6a7de56183 100644 --- a/test/win32ole/test_err_in_callback.rb +++ b/test/win32ole/test_err_in_callback.rb @@ -15,7 +15,8 @@ if defined?(WIN32OLE) 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 @@ if defined?(WIN32OLE) 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 @@ if defined?(WIN32OLE) def teardown WIN32OLE_EVENT.message_loop ie_quit + File.unlink(@f) + File.unlink("test_err_in_callback.log") end end end |