Silence Rails schema load for spork
Asked Answered
A

1

7

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.

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.

Asiatic answered 15/9, 2011 at 3:19 Comment(1)
Where are you putting 'load "#{Rails.root}/db/schema.rb"' in your spec helper file? In the Spork.each_run block or elsewhere?Besprent
V
16

This did the trick for me:

  ActiveRecord::Schema.verbose = false
  load "#{Rails.root}/db/schema.rb"
Velma answered 3/10, 2011 at 10:12 Comment(1)
Thank you so much. Spitting out the schema load each run was starting to get old very quickly.Asiatic

© 2022 - 2024 — McMap. All rights reserved.