2009-11-26 48 views
3

我正在使用RighAWS gem并嘲讽http级别,以便在我的测试中执行RightAWS代码。如何在运行测试时使以下RightAWS消息无效

发生这种情况时我得到以下输出

....New RightAws::S3Interface using per_request-connection mode Opening new HTTP connection to s3.amazonaws.com:80 .New RightAws::S3Interface using per_request-connection mode .

即使所有的测试都通过了,当我有错误,它很难对其进行扫描,因为这个输出。有没有一种很好的方式来保持沉默?

回答

6

您可以使用空设备进行登录:

s3 = RightAws::S3Interface.new(access_key, secret_key, {:port => 80, :protocol => 'http', :logger => Logger.new('/dev/null')}) //on unix system 
s3 = RightAws::S3Interface.new(access_key, secret_key, {:port => 80, :protocol => 'http', :logger => Logger.new('NUL')}) //on windows

相关问题