SQL数据库异地全自动备份
2009-07-08 16:28
513 查看
continue execution when TEST::UNIT assertion fails
Hi,
Is is possible not to halt the execution of a ruby script when an
TEST::UNIT assertion fails?
cheers
aidy
On 4/16/07, aidy <aidy.rut@gmail.com> wrote:
> Hi,
> Is is possible not to halt the execution of a ruby script when an
> TEST::UNIT assertion fails?
Yes, you can ...
begin
assert false
rescue Test::Unit::AssertionFailedError => e
self.send(:add_failure, e.message, e.backtrace)
end
Or if you would like a little method ...
def continue_test
begin
yield
rescue Test::Unit::AssertionFailedError => e
self.send(:add_failure, e.message, e.backtrace)
end
end
continue_test( assert false )
Blessings,
TwP
On 4/16/07, Tim Pease <tim.pe@gmail.com> wrote:
- Hide quoted text -
> On 4/16/07, aidy <aidy.rut@gmail.com> wrote:
> > Hi,
> > Is is possible not to halt the execution of a ruby script when an
> > TEST::UNIT assertion fails?
> Yes, you can ...
> begin
> assert false
> rescue Test::Unit::AssertionFailedError => e
> self.send(:add_failure, e.message, e.backtrace)
> end
> Or if you would like a little method ...
> def continue_test
> begin
> yield
> rescue Test::Unit::AssertionFailedError => e
> self.send(:add_failure, e.message, e.backtrace)
> end
> end
> continue_test( assert false )
Sorry, that should be a block
continue_test {assert false}
TwP
http://www.megasolutions.net/ruby/continue-execution-when-TEST_UNIT-assertion-fails-50216.aspx
相关文章推荐
- 基于WinRAR软件的文件自动打包与异地备份方案
- 自动备份并保存最近几天的SQL数据库作业脚本
- Navicat异地自动备份MySQL方法详解(图文)
- Navicat异地自动备份MySQL方法详解(图文)
- 使用ssh实现oracle数据库备份文件自动异地存储
- windows下实现mysql备份至异地,并结合计划任务实现自动管理。
- SQL Server2005异地自动备份方法
- MYSQL数据库自动本地/异地双备份/MYSQL增量备份
- Rsync企业实战之自动异地备份 推荐
- Rsync企业实战之自动异地备份(转)
- SQL数据库自动备份作业脚本
- SQL自动异地备份、删除、还原数据库(利用代理作业)
- SQL数据库备份文件自动压缩,bat
- SQl数据库自动备份
- SQL server 实现自动异地备份
- SQL自动异地备份
- Linux(Centos)全自动异地备份数据(WEB+Mysql)
- Rsync企业实战之自动异地备份
- 关于sqlserver2005异地自动备份
- 第一个小项目完成总结(sql数据库自动备份工具)