gpt4 book ai didi

ruby-on-rails - 在 rails 3.1 中运行 rspec 测试时如何抑制/禁用 "cache miss"消息

转载 作者:数据小太阳 更新时间:2023-10-29 06:50:09 27 4
gpt4 key购买 nike

在运行请求 rspec 规范时,我开始看到以下输出:

cache: [GET /login] miss
cache: [GET /javascripts/jquery.min.js?1317513028] miss

通常情况下,通过测试我会得到绿点,在错误消息中我会得到带有一些信息的红色 F。

有没有办法从输出中禁用缓存未命中消息?

最佳答案

我认为这与 rspec 无关,rspec 只是打印出 rails 日志中的内容。我觉得这个post by Brian Weaver在 Phusion Passenger 讨论组中可能会回答您的问题:

Do you have rack-cache installed? I spent a good day+ tracing through Passenger/Rails/Rack and lots of other gems to find out why lines similar to that one was appearing. Add the following to your production.rb or development.rb file to get rid of the 'cache: ....' line

config.action_dispatch.rack_cache = {:metastore => "rails:/", :entitystore => "rails:/", :verbose => false}

I pulled that line from within the "middleware" configuration of Rails an just changed the 'verbose' from true to false.

在您的情况下,我猜您想将其添加到您的测试环境文件中。

关于ruby-on-rails - 在 rails 3.1 中运行 rspec 测试时如何抑制/禁用 "cache miss"消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7652033/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com