sunspot/sunspot — pull request #439 by gaelmuller (2013-07-30 14:28:45+00:00)
Title: Added support for facet(name).rows in StubSessionProxy

Currently, code such as what is shown in the README regarding facets fails in test environement when using `StubSessionProxy`. Example code (from the README):

search.facet(:average_rating).rows.each do |facet|
puts "Number of posts with rating withing #{facet.value}: #{facet.count}"
end

This would fail using `StubSessionProxy` because `facet(:average_rating)` returns `nil`. Whis this PR, `facet(:average_rating)` would return a new instance of `FacetStub` that responds to `rows` with an empty array.