Sha256: 63ce0c30521d566171dc233a8b5b81820b2afcdc18eebfdee3f3e6357ebac9cf

Contents?: true

Size: 841 Bytes

Versions: 13

Compression:

Stored size: 841 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::SprintPcsMediaTest < 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.create(mail)
    assert_equal MMS2R::SprintPcsMedia, mms.class, "expected a #{MMS2R::SprintPcsMedia} and received a #{mms.class}"
    mms.process
    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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mms2r-1.1.0 test/test_mms2r_sprint_pcs_media.rb
mms2r-1.1.10 test/test_mms2r_sprint_pcs_media.rb
mms2r-1.1.1 test/test_mms2r_sprint_pcs_media.rb
mms2r-1.1.6 test/test_mms2r_sprint_pcs_media.rb
mms2r-1.1.12 test/test_mms2r_sprint_pcs_media.rb
mms2r-1.1.2 test/test_mms2r_sprint_pcs_media.rb
mms2r-1.1.3 test/test_mms2r_sprint_pcs_media.rb
mms2r-1.1.11 test/test_mms2r_sprint_pcs_media.rb
mms2r-1.1.4 test/test_mms2r_sprint_pcs_media.rb
mms2r-1.1.5 test/test_mms2r_sprint_pcs_media.rb
mms2r-1.1.7 test/test_mms2r_sprint_pcs_media.rb
mms2r-1.1.8 test/test_mms2r_sprint_pcs_media.rb
mms2r-1.1.9 test/test_mms2r_sprint_pcs_media.rb