class EmailSpec::Matchers::ReplyTo

Public Class Methods

new(email) click to toggle source
# File lib/email_spec/matchers.rb, line 14
def initialize(email)
  @expected_reply_to = Mail::ReplyToField.new(email).addrs.first
end

Public Instance Methods

description() click to toggle source
# File lib/email_spec/matchers.rb, line 18
def description
  "have reply to as #{@expected_reply_to.address}"
end
failure_message() click to toggle source
# File lib/email_spec/matchers.rb, line 29
def failure_message
  "expected #{@email.inspect} to reply to #{@expected_reply_to.address.inspect}, but it replied to #{@actual_reply_to.inspect}"
end
failure_message_when_negated() click to toggle source
# File lib/email_spec/matchers.rb, line 33
def failure_message_when_negated
  "expected #{@email.inspect} not to deliver to #{@expected_reply_to.address.inspect}, but it did"
end
Also aliased as: negative_failure_message
matches?(email) click to toggle source
# File lib/email_spec/matchers.rb, line 22
def matches?(email)
  @email = email
  @actual_reply_to = (email.reply_to || []).first
  !@actual_reply_to.nil? &&
    @actual_reply_to == @expected_reply_to.address
end
negative_failure_message()