Class: WebTrap::Shared::Validators::RequestSentValidator Private
- Inherits:
-
Object
- Object
- WebTrap::Shared::Validators::RequestSentValidator
- Defined in:
- lib/webtrap/shared/validators/request_sent_validator.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.
Validator for asserting whether a request was sent.
Instance Method Summary collapse
-
#failed? ⇒ Boolean
private
Whether no request was validated.
-
#failure_message ⇒ String
private
The message to be used if no request is validated.
-
#initialize ⇒ RequestSentValidator
constructor
private
Initialize a new validator.
-
#validate(_) ⇒ RequestSentValidator
private
Validate a request.
Constructor Details
#initialize ⇒ RequestSentValidator
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.
Initialize a new validator.
7 8 9 |
# File 'lib/webtrap/shared/validators/request_sent_validator.rb', line 7 def initialize @failed = true end |
Instance Method Details
#failed? ⇒ 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.
Whether no request was validated.
14 15 16 |
# File 'lib/webtrap/shared/validators/request_sent_validator.rb', line 14 def failed? @failed end |
#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.
The message to be used if no request is validated.
21 22 23 |
# File 'lib/webtrap/shared/validators/request_sent_validator.rb', line 21 def "expected block to send an HTTP request, but nothing was sent out" end |
#validate(_) ⇒ RequestSentValidator
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.
Validate a request.
Since validators are run against intercepted requests this validator will succeed for any request.
32 33 34 35 |
# File 'lib/webtrap/shared/validators/request_sent_validator.rb', line 32 def validate(_) @failed = false self end |