Sha256: 8753fff90d30bea6cda870da5c8033e171c6a11444a8ba5ba1de1311ebca6443

Contents?: true

Size: 1.21 KB

Versions: 16

Compression:

Stored size: 1.21 KB

Contents

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 TestMmsDobsonNet < Test::Unit::TestCase
  include MMS2R::TestHelper

  def test_mms_dobson_net
    # mms.dobson.net service
    mail = TMail::Mail.parse(load_mail('dobson-image-01.mail').join)
    mms = MMS2R::Media.new(mail)

    assert_equal 2, mms.media.size

    assert_not_nil mms.media['image/jpeg']
    assert_equal 1, mms.media['image/jpeg'].size
    assert_not_nil mms.media['image/jpeg'].first
    assert_match(/04-18-07_1723.jpg$/, mms.media['image/jpeg'][0])
    assert_file_size(mms.media['image/jpeg'][0], 337)

    assert_equal nil, mms.media['application/smil'] # dobson phones have weird SMIL that can be ignored.
    assert_not_nil(mms.media['text/plain'])
    assert_equal 1, mms.media['text/plain'].size
    assert_equal "Body", IO.read(mms.media['text/plain'][0])

    mms.purge
  end
  
  def test_body_should_return_user_text
    mail = TMail::Mail.parse(load_mail('dobson-image-01.mail').join)
    mms = MMS2R::Media.new(mail)
    
    assert_equal 'Body', mms.body
    
    mms.purge
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
brendanlim-mms2r-2.2.0.1 test/test_mms_dobson_net.rb
brendanlim-mms2r-2.2.0 test/test_mms_dobson_net.rb
mms2r-2.4.1 test/test_mms_dobson_net.rb
mms2r-2.4.0 test/test_mms_dobson_net.rb
mms2r-2.3.0 test/test_mms_dobson_net.rb
mms2r-2.0.1 test/test_mms_dobson_net.rb
mms2r-2.0.0 test/test_mms_dobson_net.rb
mms2r-2.0.2 test/test_mms_dobson_net.rb
mms2r-2.1.0 test/test_mms_dobson_net.rb
mms2r-2.0.5 test/test_mms_dobson_net.rb
mms2r-2.0.4 test/test_mms_dobson_net.rb
mms2r-2.0.3 test/test_mms_dobson_net.rb
mms2r-2.1.1 test/test_mms_dobson_net.rb
mms2r-2.1.2 test/test_mms_dobson_net.rb
mms2r-2.1.3 test/test_mms_dobson_net.rb
mms2r-2.2.0 test/test_mms_dobson_net.rb