I'm sorry for commenting on this one so so very late, but this will spin up solr on every startup, which can be really a nuisance when you want to run single tests that do not use solr.

I also find it confusing to have `SunspotTest.stub`, just to be contradicted right the next line with `#setup_solr` that unstubs the session.

My approach nowadays is to:

```ruby
# test_helper.rb

require "sunspot_test"
SunspotTest.stub

# since Test::Unit doesn't have the privileges of tags, I use a simple helper:

class ActiveSupport::TestCase # or MiniTest::Unit::TestCase or Unit::TestCase

  def with_sunspot
    SunspotTest.setup_solr
    Sunspot.remove_all!
    Sunspot.commit
    yield
    SunspotTest.stub
  end

end
```