1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
require 'test_helper'
require 'mail/gpg/version_part'
class VersionPartTest < MailGpgTestCase
context 'VersionPart' do
should 'roundtrip successfully' do
part = Mail::Gpg::VersionPart.new()
assert Mail::Gpg::VersionPart.isVersionPart?(part)
end
should 'return false for non gpg mime type' do
part = Mail::Gpg::VersionPart.new()
part.content_type = 'text/plain'
assert !Mail::Gpg::VersionPart.isVersionPart?(part)
end
should 'return false for empty body' do
part = Mail::Gpg::VersionPart.new()
part.body = nil
assert !Mail::Gpg::VersionPart.isVersionPart?(part)
end
should 'return false for foul body' do
part = Mail::Gpg::VersionPart.new()
part.body = 'non gpg body'
assert !Mail::Gpg::VersionPart.isVersionPart?(part)
end
should 'return true for body with extra content' do
part = Mail::Gpg::VersionPart.new()
part.body = "#{part.body} extra content"
assert Mail::Gpg::VersionPart.isVersionPart?(part)
end
end
end
|