lib/email_spec/matchers.rb in email_spec-0.3.6 vs lib/email_spec/matchers.rb in email_spec-0.3.7
- old
+ new
@@ -16,11 +16,11 @@
"be delivered to #{@expected_email_addresses.inspect}"
end
def matches?(email)
@email = email
- @actual_recipients = (email.to || []).sort
+ @actual_recipients = (Array(email.to) || []).sort
@actual_recipients == @expected_email_addresses
end
def failure_message
"expected #{@email.inspect} to deliver to #{@expected_email_addresses.inspect}, but it delivered to #{@actual_recipients.inspect}"
@@ -82,10 +82,10 @@
"be bcc'd to #{@expected_email_addresses.inspect}"
end
def matches?(email)
@email = email
- @actual_recipients = (email.bcc || []).sort
+ @actual_recipients = (Array(email.bcc) || []).sort
@actual_recipients == @expected_email_addresses
end
def failure_message
"expected #{@email.inspect} to bcc to #{@expected_email_addresses.inspect}, but it was bcc'd to #{@actual_recipients.inspect}"