Sha256: e4e608853cbd3d23ccb1dfdc498a413aa52687901e0992fc7bb9e4c9b7641084
Contents?: true
Size: 1.13 KB
Versions: 8
Compression:
Stored size: 1.13 KB
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::HelioMediaTest < Test::Unit::TestCase include MMS2R::TestHelper def setup mail = TMail::Mail.parse(load_mail('helio-image-01.mail').join) @mms = MMS2R::Media.create(mail) @mms.process end def test_instantiated_class_should_be_helio_media assert_equal @mms.class, MMS2R::HelioMedia end def test_get_number_should_return_correct_number number = @mms.get_number() assert_equal number, 7608070850.to_s end def test_get_subject_should_return_correct_subject title = @mms.get_subject() assert_equal title, "Test image" end def test_get_body_should_return_correct_body body = @mms.get_body() assert_equal body, "Test image" end def test_get_attachment_should_return_jpeg image = @mms.get_media() assert_not_nil @mms.media['image/jpeg'][0] assert_match(/0628070005.jpg$/, @mms.media['image/jpeg'][0]) end def teardown @mms.purge end end
Version data entries
8 entries across 8 versions & 1 rubygems