Class: Katalyst::Kpop::Matchers::ResponseMatcher Private

Inherits:
Base
  • Object
show all
Defined in:
lib/katalyst/kpop/matchers/response_matcher.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary

Attributes inherited from Base

#matched

Instance Method Summary collapse

Methods inherited from Base

#matches?

Instance Method Details

#descriptionObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
# File 'lib/katalyst/kpop/matchers/response_matcher.rb', line 19

def description
  "a response"
end

#failure_messageObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



23
24
25
# File 'lib/katalyst/kpop/matchers/response_matcher.rb', line 23

def failure_message
  "expected a response but received #{actual.inspect} instead"
end

#failure_message_when_negatedObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



27
28
29
# File 'lib/katalyst/kpop/matchers/response_matcher.rb', line 27

def failure_message_when_negated
  "expected not to receive a response"
end

#match(_, actual) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



10
11
12
13
14
15
16
17
# File 'lib/katalyst/kpop/matchers/response_matcher.rb', line 10

def match(_, actual)
  case actual
  when ::ActionDispatch::Response
    ::ActionDispatch::TestResponse.from_response(actual)
  when ::ActionDispatch::TestResponse
    actual
  end
end