class SunspotMatchers::BeASearchForSession
Public Class Methods
new(session, expected_class)
click to toggle source
# File lib/sunspot_matchers/test_helper.rb, line 41 def initialize(session, expected_class) @session = session @expected_class = expected_class end
Public Instance Methods
failure_message_for_should()
click to toggle source
# File lib/sunspot_matchers/test_helper.rb, line 60 def failure_message_for_should "expected search class: #{search_types.join(' and ')} to match expected class: #{@expected_class}" end
failure_message_for_should_not()
click to toggle source
# File lib/sunspot_matchers/test_helper.rb, line 64 def failure_message_for_should_not "expected search class: #{search_types.join(' and ')} NOT to match expected class: #{@expected_class}" end
match?()
click to toggle source
# File lib/sunspot_matchers/test_helper.rb, line 46 def match? search_types.include?(@expected_class) end
search_tuple()
click to toggle source
# File lib/sunspot_matchers/test_helper.rb, line 50 def search_tuple search_tuple = @session.is_a?(Array) ? @session : @session.searches.last raise 'no search found' unless search_tuple search_tuple end
search_types()
click to toggle source
# File lib/sunspot_matchers/test_helper.rb, line 56 def search_types search_tuple.first end