Class: WebTrap::RSpec::Matchers::SendRequestWithXml
- Inherits:
-
SendRequest
- Object
- SendRequest
- WebTrap::RSpec::Matchers::SendRequestWithXml
- Defined in:
- lib/webtrap/rspec/matchers/send_request_with_xml.rb
Instance Attribute Summary collapse
-
#expected_payload ⇒ Object
readonly
Returns the value of attribute expected_payload.
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(expected_payload) ⇒ SendRequestWithXml
constructor
A new instance of SendRequestWithXml.
- #matches?(transmission_proc) ⇒ Boolean
- #supports_block_expectations? ⇒ Boolean
Methods inherited from SendRequest
Constructor Details
#initialize(expected_payload) ⇒ SendRequestWithXml
Returns a new instance of SendRequestWithXml.
10 11 12 |
# File 'lib/webtrap/rspec/matchers/send_request_with_xml.rb', line 10 def initialize(expected_payload) @expected_payload = expected_payload end |
Instance Attribute Details
#expected_payload ⇒ Object (readonly)
Returns the value of attribute expected_payload.
8 9 10 |
# File 'lib/webtrap/rspec/matchers/send_request_with_xml.rb', line 8 def expected_payload @expected_payload end |
Instance Method Details
#failure_message ⇒ Object
19 20 21 22 23 |
# File 'lib/webtrap/rspec/matchers/send_request_with_xml.rb', line 19 def return super unless request_sent? "expected block to send an HTTP request with XML body, but payload was not equivalent" end |
#matches?(transmission_proc) ⇒ Boolean
14 15 16 17 |
# File 'lib/webtrap/rspec/matchers/send_request_with_xml.rb', line 14 def matches?(transmission_proc) perform_transmission(transmission_proc) request_sent? && valid_payload? end |
#supports_block_expectations? ⇒ Boolean
25 26 27 |
# File 'lib/webtrap/rspec/matchers/send_request_with_xml.rb', line 25 def supports_block_expectations? true end |