lib/email_spec/matchers.rb in email_spec-1.6.0 vs lib/email_spec/matchers.rb in email_spec-2.0.0
- old
+ new
@@ -55,10 +55,11 @@
"be delivered to #{@expected_recipients.inspect}"
end
def matches?(email)
@email = email
- @actual_recipients = address_array{ email.header[:to].addrs }.map(&:to_s).sort
+ recipients = email.header[:to] || email.header[:bcc]
+ @actual_recipients = address_array{ recipients && recipients.addrs }.map(&:to_s).sort
@actual_recipients == @expected_recipients
end
def failure_message
"expected #{@email.inspect} to deliver to #{@expected_recipients.inspect}, but it delivered to #{@actual_recipients.inspect}"