Sha256: e034aabae6f1c9da9d57b2e7be1fb1dbf136608e18a7cc1cf6e83ddf17c5cc0e
Contents?: true
Size: 981 Bytes
Versions: 1
Compression:
Stored size: 981 Bytes
Contents
$:.unshift File.join(File.dirname(__FILE__), "..", "lib") require File.dirname(__FILE__) + "/test_helper" require 'test/unit' require 'rubygems' require 'mms2r' require 'mms2r/media' require 'tmail/mail' require 'logger' class MMS2R::ATTMediaTest < Test::Unit::TestCase include MMS2R::TestHelper def setup @log = Logger.new(STDOUT) @log.level = Logger::DEBUG @log.datetime_format = "%H:%M:%S" end def teardown; end def test_simple mail = TMail::Mail.parse(load_mail('att-image-01.mail').join) mms = MMS2R::Media.create(mail) assert_equal(MMS2R::ATTMedia, mms.class, "expected a #{MMS2R::ATTMedia} and received a #{mms.class}") mms.process assert(mms.media.size == 1) assert_nil(mms.media['text/plain']) assert_nil(mms.media['text/html']) assert_not_nil(mms.media['image/jpeg'][0]) assert_match(/Photo_12.jpg$/, mms.media['image/jpeg'][0]) assert_file_size(mms.media['image/jpeg'][0], 337) mms.purge end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mms2r-1.1.4 | test/test_mms2r_a_t_t_media.rb |