Class: WebTrap::RSpec::Matchers::SendRequest Private
- Inherits:
-
Object
- Object
- WebTrap::RSpec::Matchers::SendRequest
- Defined in:
- lib/webtrap/rspec/matchers/send_request.rb
Overview
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.
Provides the implementation for ‘send_request`. Not intended to be instantiated directly.
Direct Known Subclasses
Instance Method Summary collapse
-
#failure_message ⇒ String
private
Message to be shown if the expectation fails to pass.
-
#matches?(transmission_proc) ⇒ Boolean
private
Checks if the provided Proc sends an HTTP request.
-
#supports_block_expectations? ⇒ TrueClass
private
Allows the matcher to be used with block expectations.
-
#with_xml(xml) ⇒ SendRequestWithXml
Specifies the XML payload of the request.
Instance Method Details
#failure_message ⇒ String
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.
Message to be shown if the expectation fails to pass.
43 44 45 |
# File 'lib/webtrap/rspec/matchers/send_request.rb', line 43 def "expected block to send an HTTP request, but nothing was sent out" end |
#matches?(transmission_proc) ⇒ Boolean
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.
Checks if the provided Proc sends an HTTP request.
35 36 37 38 |
# File 'lib/webtrap/rspec/matchers/send_request.rb', line 35 def matches?(transmission_proc) perform_transmission(transmission_proc) request_sent? end |
#supports_block_expectations? ⇒ TrueClass
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.
Allows the matcher to be used with block expectations.
50 51 52 |
# File 'lib/webtrap/rspec/matchers/send_request.rb', line 50 def supports_block_expectations? true end |
#with_xml(xml) ⇒ SendRequestWithXml
Specifies the XML payload of the request.
The expectation will pass only if a request is sent with a payload that is considered equivalent to the reference. For further details see the equivalent-xml gem.
24 25 26 |
# File 'lib/webtrap/rspec/matchers/send_request.rb', line 24 def with_xml(xml) SendRequestWithXml.new(xml) end |