require File.join(File.dirname(__FILE__), "..", "lib", "mms2r") require File.join(File.dirname(__FILE__), "test_helper") require 'test/unit' require 'rubygems' require 'mocha' gem 'tmail', '>= 1.2.1' require 'tmail' class TestMessagingSprintpcsCom < Test::Unit::TestCase include MMS2R::TestHelper def test_simple_text mail = TMail::Mail.parse(load_mail('sprint-pcs-text-01.mail').join) mms = MMS2R::Media.new(mail) assert_equal 1, mms.media.size assert_not_nil mms.media['text/plain'] file = mms.media['text/plain'][0] assert_not_nil file assert File::exist?(file), "file #{file} does not exist" text = IO.readlines("#{file}").join assert_match(/hello world/, text) mms.purge end end