Skip to content

Instantly share code, notes, and snippets.

View fuzzyalej's full-sized avatar
🎯
Focusing

Alejandro Andrés fuzzyalej

🎯
Focusing
View GitHub Profile
@rick
rick / custom_matchers.rb
Created November 2, 2008 22:26
thinking sphinx custom rspec matchers
module ThinkingSphinxIndexMatcher
class HaveIndex
def initialize(expected)
@expected = expected
end
def matches?(target)
@target = target
target.sphinx_indexes.collect(&:fields).flatten.collect(&:columns).flatten.collect(&:__name).include?(@expected)
end