Class: RSpec::Rails::Matchers::SendEmail Private
- Inherits:
-
BaseMatcher
- Object
- BaseMatcher
- RSpec::Rails::Matchers::SendEmail
- Defined in:
- lib/rspec/rails/matchers/send_email.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.
Matcher class for send_email
. Should not be instantiated directly.
Constant Summary collapse
- INSPECT_EMAIL_ATTRIBUTES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Define the email attributes that should be included in the inspection output.
%i[subject from to cc bcc].freeze
Constants inherited from BaseMatcher
Instance Method Summary collapse
- #failure_message ⇒ String private
- #failure_message_when_negated ⇒ String private
-
#initialize(criteria) ⇒ SendEmail
constructor
private
A new instance of SendEmail.
- #matches?(block) ⇒ Boolean private
- #supports_block_expectations? ⇒ Boolean private
- #supports_value_expectations? ⇒ Boolean private
Methods inherited from BaseMatcher
#description, #expects_call_stack_jump?, #match_unless_raises
Constructor Details
#initialize(criteria) ⇒ SendEmail
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.
Returns a new instance of SendEmail.
16 17 18 |
# File 'lib/rspec/rails/matchers/send_email.rb', line 16 def initialize(criteria) @criteria = criteria end |
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.
38 39 40 41 42 43 44 45 46 |
# File 'lib/rspec/rails/matchers/send_email.rb', line 38 def result = if multiple_match? "More than 1 matching emails were sent." else "No matching emails were sent." end "#{result}#{}" end |
#failure_message_when_negated ⇒ 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.
50 51 52 |
# File 'lib/rspec/rails/matchers/send_email.rb', line 50 def "Expected not to send an email but it was sent." end |
#matches?(block) ⇒ 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.
30 31 32 33 34 |
# File 'lib/rspec/rails/matchers/send_email.rb', line 30 def matches?(block) define_matched_emails(block) @matched_emails.one? end |
#supports_block_expectations? ⇒ 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.
26 27 28 |
# File 'lib/rspec/rails/matchers/send_email.rb', line 26 def supports_block_expectations? true end |
#supports_value_expectations? ⇒ 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.
21 22 23 |
# File 'lib/rspec/rails/matchers/send_email.rb', line 21 def supports_value_expectations? false end |