#=========================
横空出世,ruby testframe
原创
©著作权归作者所有:来自51CTO博客作者leijmdas的原创作品,请联系作者获取转载授权,否则将追究法律责任
#!/usr/bin/env ruby -w
#coding:gbk
#=========================
#
# author: leijm
# date : 2012-07-24 22:57:28
# file name: testrb.rb
#
# 1 测试套自动注册
# 2 多版本支持
# 3 checkRetcode 支持报错返回错误码
# 4 单用例执行
# 5 前后台执行
#
#=========================
#Ruby的类库中最大限度灵活运用Template Method模式的部分,应该说是Enumerable模块和Comparable模块了。
# Enumerable模块中实现循环的each方法采用了Template Method模式。表4-2是Enumerable模块的方法一览。
# 表4-2 Enumerable提供的方法
# 方 法 名 功 能
# all? 是否所有元素都为真
# all?{|x|...} 块是否对所有元素都为真
# any? 是否至少有一个元素为真
# any?{|x|...} 块是否对至少有一个元素为真
# collect{|x|...} 对各元素进行块中的计算,返回结果的数组
# detect{|x|...} 返回使块为真的第1个元素
# each_with_index{|x,i|...} 对各元素和下标进行块中的计算
# entries 返回元素的数组
# find{|x|...} 返回使块为真的第1个元素
# find_all{|x|...} 返回使块为真的所有元素的数组
# grep(pattern) 返回匹配检索模式的所有元素的数组
# grep(pattern){|x|...} 对匹配检索模式的所有元素进行块中的计算
# include?(x) 是否有元素与x相等
# inject{|x,y|...} 返回对各元素进行块中的计算的结果
# inject(init){|x,y|...} 返回对各元素进行块中的计算的结果
# map{|x|...} 对各元素进行块中的计算,返回结果的数组
# max 返回最大的元素
# max{|a,b|...} 使用块中的比较方法,返回最大的元素
#
# max_by{|x|...} 对各元素进行块中的变换,返回结果最大的元素(Ruby 1.9)
# member?(x) 是否有元素与x相等
# min 返回最小的元素
# min{|a,b|...} 使用块中的比较方法,返回最小的元素
# min_by{|x|...} 对各元素进行块中的变换,返回结果最小的元素(Ruby 1.9)
# partition{|x|...} 把使块为真的元素和使块为假的元素分离开
# reject{|x|...} 返回使块为假的元素的数组
# select{|x|...} 返回使块为真的元素的数组
# sort 对元素排序
# sort{|a,b|...} 使用块中的比较方法,对元素排序
# sort_by{|x|...} 对各元素进行块中的变换,按照变换结果对元素进行排序
# to_a 返回元素的数组
# zip(a,...) 返回各集合串接后的数组
# zip(a,...){|arr|...} 对集合进行串接,然后进行块中的计算
load 'public/Testhelper.rb'
Testhelper::LoadHelper.loadpath
require 'ITestRunner'
require 'ITestcode'
$VERSION= Testconst::VERSION_DEFAULT
class ITestRunner
def help
puts "testrb.rb -h"
puts "testrb.rb -all"
self
end
#gets
end
runner=ITestRunner.instance
#runner.run( )#Testconst::VERSION_BM200 Testconst::VERSION_DEFAULT
#ITestRunnerTest.instance.run(:TestConfigHelper,:testCfg)
#ITestRunnerSuite.instance.run( :TestProxy ) #:TestThread :TestBSInfo :TestProxy
#ITestRunnerSuite.instance.run( :TestBSInfo ) #:TestThread :TestBSInfo :TestProxy
#ITestRunnerSuite.instance.run( :TestBinlog_300 ,Testconst::VERSION_BM300 )
ITestRunnerSuite.instance.run( :TestcaseSqlite )
ITestRunnerSuite.instance.run( :TestThread )
#bsinfo=BSTestInfo.new
#puts cmd= bsinfo.cmdtype
#
上一篇:西蒙,一个值得尊敬的架构师--写在深圳全球架构师峰会之后
下一篇:我的友情链接
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Linux横空出世
GNU/Linux 【内容摘要】 1991年,芬兰的赫尔辛基大学的Linus Torvalds在BBS上面贴了一则消息,宣称他以bash、g
操作系统 linux unix linux内核 -
永中mac横空出世
永中 Office 2012 for mac :word,excel,ppt一应俱全
mac excel Office -
横空出世的Rust
声明: 文章仅代表个人观点曾几何时,我认为C语言永远不会过时,只要有计算机存在,C
Rust 执行效率 编程语言 -
RedisJson横空出世,性能碾压ES和Mongo
一、概述近期官网给出了RedisJson(RedisSearch)的性能测试报告,可谓碾压其他NoSQL,下
redis json elasticsearch