ruby unit

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#!/usr/bin/env ruby #-w
# coding:gbk  

#''' 
#  author: leijming
#  date :20120701
#'''

load 'public/Testhelper.rb'
begin
Testhelper::LoadHelper.loadpath
rescue =>e
puts e.message
 
end

 require 'ITestRunner'  
#require 'builder/xmlmarkup'


class ITestRunner
  def run
    unlinklog
    begin
      autoLoadsuite
    rescue =>e
      puts e.message
    ensure

      
      ITestsuite.showSuite
      ITestsuite.run
      ITestsuite.countSumSuite
      ITestsuite.showSumsuite
      
    end
    self     
    
  end
  
  def help
    puts "testrb.rb -h"
    puts "testrb.rb -all"
    self
  end
  #gets
end

class ITestRunnerSuite< ITestRunner
  
 def run(suitename) 
    unlinklog
    autoLoadsuite
    
    ITestsuite.showSuite
    ITestsuite.run
    ITestsuite.countSuite
    ITestsuite.showSumsuite
    self    #exit
  end
end

class ITestRunnerTest< ITestRunner
  
 def run(suitename,testname) 
    unlinklog
    autoLoadsuite
    
    ITestsuite.showSuite
    ITestsuite.run
    ITestsuite.countSuite
    self    #exit
  end
end
 
ITestRunner.instance.run
ITestRunner.instance.help