0
我有一些缓慢的RSpec测试,我用:slow
标记。我已经将RSpec设置为通过在我的RSpec配置中添加行config.filter_run_excluding slow: true
来跳过默认设置。我可以通过运行rspec --tag slow
来运行缓慢的测试。Rspec:跳过排除过滤器
但我怎么能运行所有使用一个命令,包括慢和非慢速测试的测试?我无法从文档中找到它。
我有一些缓慢的RSpec测试,我用:slow
标记。我已经将RSpec设置为通过在我的RSpec配置中添加行config.filter_run_excluding slow: true
来跳过默认设置。我可以通过运行rspec --tag slow
来运行缓慢的测试。Rspec:跳过排除过滤器
但我怎么能运行所有使用一个命令,包括慢和非慢速测试的测试?我无法从文档中找到它。
你可以找到一个类似的问题在这里:Command line to run all examples in RSpec, including ones that are filtered out?
在几句话,这个功能并不存在于rspec的,但你可以使用环境变量:
RSpec.configure do |c|
c.filter_run_excluding slow: true unless ENV['ALL']
end
呼叫ALL=1 rspec
将运行所有的规格包括慢标签。