Class: SunspotMatchers::HaveSearchParamsForSession
- Inherits:
-
Object
- Object
- SunspotMatchers::HaveSearchParamsForSession
- Includes:
- MiniTest::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.
9 10 11 12 13 |
# File 'lib/sunspot_matchers/test_helper.rb', line 9 def initialize(session, method, *args, &block) @session = session @method = method @args = (block.nil? ? args : [*args, block]) end |
Instance Method Details
#get_matcher ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/sunspot_matchers/test_helper.rb', line 15 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 |