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>
 | 
					Mon Mar 18 13:29:52 2013  NARUSE, Yui  <naruse@ruby-lang.org>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* vm_dump.c (backtrace): on darwin use custom backtrace() to trace
 | 
						* vm_dump.c (backtrace): on darwin use custom backtrace() to trace
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,6 +10,7 @@ end
 | 
				
			||||||
if defined?(WIN32OLE)
 | 
					if defined?(WIN32OLE)
 | 
				
			||||||
  require 'mkmf'
 | 
					  require 'mkmf'
 | 
				
			||||||
  require 'test/unit'
 | 
					  require 'test/unit'
 | 
				
			||||||
 | 
					  require 'tmpdir'
 | 
				
			||||||
  class TestErrInCallBack < Test::Unit::TestCase
 | 
					  class TestErrInCallBack < Test::Unit::TestCase
 | 
				
			||||||
    def setup
 | 
					    def setup
 | 
				
			||||||
      @ruby = nil
 | 
					      @ruby = nil
 | 
				
			||||||
| 
						 | 
					@ -35,18 +36,17 @@ if defined?(WIN32OLE)
 | 
				
			||||||
    def test_err_in_callback
 | 
					    def test_err_in_callback
 | 
				
			||||||
      skip "'ADODB.Connection' is not available" unless available_adodb?
 | 
					      skip "'ADODB.Connection' is not available" unless available_adodb?
 | 
				
			||||||
      if @ruby
 | 
					      if @ruby
 | 
				
			||||||
        cmd = "#{@ruby} -v #{@iopt} #{@script} > test_err_in_callback.log 2>&1"
 | 
					        Dir.mktmpdir do |tmpdir|
 | 
				
			||||||
        system(cmd)
 | 
					          logfile = File.join(tmpdir, "test_err_in_callback.log")
 | 
				
			||||||
        str = ""
 | 
					          cmd = "#{@ruby} -v #{@iopt} #{@script} > #{logfile.gsub(%r(/), '\\')} 2>&1"
 | 
				
			||||||
        open("test_err_in_callback.log") {|ifs|
 | 
					          system(cmd)
 | 
				
			||||||
          str = ifs.read
 | 
					          str = ""
 | 
				
			||||||
        }
 | 
					          open(logfile) {|ifs|
 | 
				
			||||||
        assert_match(/NameError/, str)
 | 
					            str = ifs.read
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					          assert_match(/NameError/, str)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					 | 
				
			||||||
    def teardown
 | 
					 | 
				
			||||||
      File.unlink("test_err_in_callback.log") if File.exist?("test_err_in_callback.log")
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue