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.



17
18
19
# File 'lib/katalyst/kpop/matchers/response_matcher.rb', line 17

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.



21
22
23
# File 'lib/katalyst/kpop/matchers/response_matcher.rb', line 21

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.



25
26
27
# File 'lib/katalyst/kpop/matchers/response_matcher.rb', line 25

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.



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

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