Rspec: 如何在运行测试时抑制警告和通知?[英] Rspec: How to suppress warnings and notices when running tests?

本文是小编为大家收集整理的关于Rspec: 如何在运行测试时抑制警告和通知?的处理方法,想解了Rspec: 如何在运行测试时抑制警告和通知?的问题怎么解决?Rspec: 如何在运行测试时抑制警告和通知?问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

我之前使用的是 Mysql 数据库并决定切换到 Postgresql,现在,当我使用 rspec 运行测试时,我收到了很多警告和通知.

WARNING:  there is already a transaction in progress
NOTICE:  there is no transaction in progress
      should has link "Suspender"
WARNING:  there is already a transaction in progress
NOTICE:  there is no transaction in progress
      should has css "title" with text "Suspensão de anúncio"
WARNING:  there is already a transaction in progress
NOTICE:  there is no transaction in progress
      should has css "h1" with text "Awesome job!"

我怎样才能抑制它?有没有办法对吧?

推荐答案

你是否设置了: config.use_transactional_examples = true 为 false 看看是否会破坏什么?

本文地址:https://www.itbaoku.cn/post/1763738.html