module EmailSpec::MailExt

Public Instance Methods

default_part() click to toggle source
# File lib/email_spec/mail_ext.rb, line 2
def default_part
  @default_part ||= html_part || text_part || self
end
default_part_body() click to toggle source
# File lib/email_spec/mail_ext.rb, line 6
def default_part_body
  # Calling to_str as we want the actual String object
  HTMLEntities.new.decode(default_part.body.to_s.to_str)
end
html() click to toggle source
# File lib/email_spec/mail_ext.rb, line 11
def html
  html_part ? html_part.body.raw_source : nil
end