Spork的Silence Rails模式负载 [英] Silence Rails schema load for spork

查看:128
本文介绍了Spork的Silence Rails模式负载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Rails 3.0环境中运行rspec.我们刚刚切换到在内存数据库中使用sqlite3进行测试.

I'm running rspec on a rails 3.0 environment. We've just switched to using sqlite3 in memory database for tests.

要使其正常工作,您需要在每次运行时加载架构.

To get this to work, you need to load the schema each run.

麻烦的是,您从架构加载中获得了很多输出.

The trouble with this is that you get a lot of output from the schema load.

根据,看来Spork正在以某种方式捕获此输出.因此,无论您做什么(silence_stream),架构负载的输出仍将继续通过.

According to this, it appears that Spork is somehow capturing this output. So no matter what you do (silence_stream), the output of the schema load will still continue to come through.

有没有一种方法可以使这个沉默?输出会减慢整个测试周期,并使其非常烦人.

Is there a way to silence this in spork? The output is slows down the whole testing cycle and makes it very annoying.

推荐答案

这对我有用:

  ActiveRecord::Schema.verbose = false
  load "#{Rails.root}/db/schema.rb"

这篇关于Spork的Silence Rails模式负载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆