Module: SunspotMatchersTestunit

Defined in:
lib/sunspot_matchers_testunit/version.rb,
lib/sunspot_matchers_testunit/matchers.rb,
lib/sunspot_matchers_testunit/sunspot_session_spy.rb

Defined Under Namespace

Classes: BaseMatcher, BeASearchFor, BoostMatcher, FacetMatcher, HaveSearchParams, KeywordsMatcher, OrderByMatcher, PaginationMatcher, SunspotSearchSpy, SunspotSessionSpy, WithMatcher, WithoutMatcher

Constant Summary collapse

VERSION =
"1.1.1"

Instance Method Summary collapse

Instance Method Details

#assert_has_no_search_params(session, *method_and_args) ⇒ Object



162
163
164
165
166
# File 'lib/sunspot_matchers_testunit/matchers.rb', line 162

def assert_has_no_search_params(session, *method_and_args)
  method, *args = method_and_args
  matcher = HaveSearchParams.new(session, method, *args).get_matcher
  assert !matcher.match?, matcher.unexpected_match_error_message
end

#assert_has_search_params(session, *method_and_args) ⇒ Object



156
157
158
159
160
# File 'lib/sunspot_matchers_testunit/matchers.rb', line 156

def assert_has_search_params(session, *method_and_args)
  method, *args = method_and_args
  matcher = HaveSearchParams.new(session, method, *args).get_matcher
  assert matcher.match?, matcher.missing_param_error_message
end

#assert_is_not_search_for(session, expected_class) ⇒ Object



309
310
311
312
# File 'lib/sunspot_matchers_testunit/matchers.rb', line 309

def assert_is_not_search_for(session, expected_class)
  matcher = BeASearchFor.new(session, expected_class)
  assert !matcher.match?, matcher.failure_message_for_should_not
end

#assert_is_search_for(session, expected_class) ⇒ Object



304
305
306
307
# File 'lib/sunspot_matchers_testunit/matchers.rb', line 304

def assert_is_search_for(session, expected_class)
  matcher = BeASearchFor.new(session, expected_class)
  assert matcher.match?, matcher.failure_message_for_should
end