mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/win32ole/test_err_in_callback.rb
(TestErrInCallBack#test_err_in_callback): shouldn't create a file in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
aa24857f12
commit
ac454412ab
2 changed files with 17 additions and 11 deletions
|
@ -1,3 +1,9 @@
|
|||
Mon Mar 18 14:46:19 2013 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* test/win32ole/test_err_in_callback.rb
|
||||
(TestErrInCallBack#test_err_in_callback): shouldn't create a file in
|
||||
source directory.
|
||||
|
||||
Mon Mar 18 13:29:52 2013 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* vm_dump.c (backtrace): on darwin use custom backtrace() to trace
|
||||
|
|
|
@ -10,6 +10,7 @@ end
|
|||
if defined?(WIN32OLE)
|
||||
require 'mkmf'
|
||||
require 'test/unit'
|
||||
require 'tmpdir'
|
||||
class TestErrInCallBack < Test::Unit::TestCase
|
||||
def setup
|
||||
@ruby = nil
|
||||
|
@ -35,18 +36,17 @@ if defined?(WIN32OLE)
|
|||
def test_err_in_callback
|
||||
skip "'ADODB.Connection' is not available" unless available_adodb?
|
||||
if @ruby
|
||||
cmd = "#{@ruby} -v #{@iopt} #{@script} > test_err_in_callback.log 2>&1"
|
||||
system(cmd)
|
||||
str = ""
|
||||
open("test_err_in_callback.log") {|ifs|
|
||||
str = ifs.read
|
||||
}
|
||||
assert_match(/NameError/, str)
|
||||
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)
|
||||
str = ""
|
||||
open(logfile) {|ifs|
|
||||
str = ifs.read
|
||||
}
|
||||
assert_match(/NameError/, str)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def teardown
|
||||
File.unlink("test_err_in_callback.log") if File.exist?("test_err_in_callback.log")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue