Acts as Solr 3x Performance Boost on Tests

ruby testing tdd bdd acts_as_solr performance


If you're using acts_as_solr and not disabling it on your tests, or want to enable or disable it selectively, try my fork of mattmatt-acts_as_solr on

In a nutshell, you put this in your test_helper:

ActsAsSolr::Post.strategy :fake

Then in your tests where you want to enable and disable it after just do (assuming you're using test/unit):

def setup
  ActsAsSolr::Post.strategy :real

def teardown
  ActsAsSolr::Post.strategy :fake

Note: If you're using RSpec / Bacon / <insert testing framework here>, this won't be a problem, just replace the code above with before / after, setup /teardown blocks etc etc

blog comments powered by Disqus