|
Revision 8565, 0.8 kB
(checked in by bitsweat, 1 year ago)
|
require abstract_unit directly since test is in load path
|
| Line | |
|---|
| 1 |
require 'abstract_unit' |
|---|
| 2 |
|
|---|
| 3 |
class TMailMailTest < Test::Unit::TestCase |
|---|
| 4 |
def test_body |
|---|
| 5 |
m = TMail::Mail.new |
|---|
| 6 |
expected = 'something_with_underscores' |
|---|
| 7 |
m.encoding = 'quoted-printable' |
|---|
| 8 |
quoted_body = [expected].pack('*M') |
|---|
| 9 |
m.body = quoted_body |
|---|
| 10 |
assert_equal "something_with_underscores=\n", m.quoted_body |
|---|
| 11 |
assert_equal expected, m.body |
|---|
| 12 |
end |
|---|
| 13 |
|
|---|
| 14 |
def test_nested_attachments_are_recognized_correctly |
|---|
| 15 |
fixture = File.read("#{File.dirname(__FILE__)}/fixtures/raw_email_with_nested_attachment") |
|---|
| 16 |
mail = TMail::Mail.parse(fixture) |
|---|
| 17 |
assert_equal 2, mail.attachments.length |
|---|
| 18 |
assert_equal "image/png", mail.attachments.first.content_type |
|---|
| 19 |
assert_equal 1902, mail.attachments.first.length |
|---|
| 20 |
assert_equal "application/pkcs7-signature", mail.attachments.last.content_type |
|---|
| 21 |
end |
|---|
| 22 |
end |
|---|