Class: SunspotMatchers::HaveSearchParamsForSession
- Inherits:
-
Object
- Object
- SunspotMatchers::HaveSearchParamsForSession
- Includes:
- MiniTest::Assertions, Test::Unit::Assertions
- Defined in:
- lib/sunspot_matchers/test_helper.rb
Instance Method Summary collapse
- #get_matcher ⇒ Object
-
#initialize(session, method, *args, &block) ⇒ HaveSearchParamsForSession
constructor
A new instance of HaveSearchParamsForSession.
Constructor Details
#initialize(session, method, *args, &block) ⇒ HaveSearchParamsForSession
Returns a new instance of HaveSearchParamsForSession.
12 13 14 15 16 |
# File 'lib/sunspot_matchers/test_helper.rb', line 12 def initialize(session, method, *args, &block) @session = session @method = method @args = (block.nil? ? args : [*args, block]) end |
Instance Method Details
#get_matcher ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/sunspot_matchers/test_helper.rb', line 18 def get_matcher matcher_class = case @method when :with WithMatcher when :without WithoutMatcher when :keywords, :fulltext KeywordsMatcher when :boost BoostMatcher when :facet FacetMatcher when :order_by OrderByMatcher when :paginate PaginationMatcher end matcher_class.new(@session, @args) end |