Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8257

Show
Ignore:
Timestamp:
12/02/07 20:31:39 (1 year ago)
Author:
nzkoz
Message:

Remove old tests which relied on @ being an ATOM to work around old Mail.app bugs. Closes #10317 [mikel]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/base64.rb

    r8084 r8257  
    1 =begin rdoc 
     1# = TITLE: 
     2
     3#   Base64 
     4
     5# = COPYRIGHT: 
     6
     7#   Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net> 
     8
     9#   Permission is hereby granted, free of charge, to any person obtaining 
     10#   a copy of this software and associated documentation files (the 
     11#   "Software"), to deal in the Software without restriction, including 
     12#   without limitation the rights to use, copy, modify, merge, publish, 
     13#   distribute, sublicense, and/or sell copies of the Software, and to 
     14#   permit persons to whom the Software is furnished to do so, subject to 
     15#   the following conditions: 
     16
     17#   The above copyright notice and this permission notice shall be 
     18#   included in all copies or substantial portions of the Software. 
     19
     20#   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
     21#   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
     22#   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
     23#   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 
     24#   LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
     25#   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 
     26#   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
     27
     28#   Note: Originally licensed under LGPL v2+. Using MIT license for Rails 
     29#   with permission of Minero Aoki. 
    230 
    3 = Base64 handling class 
    4  
    5 =end 
    6 #-- 
    7 # Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net> 
    831# 
    9 # Permission is hereby granted, free of charge, to any person obtaining 
    10 # a copy of this software and associated documentation files (the 
    11 # "Software"), to deal in the Software without restriction, including 
    12 # without limitation the rights to use, copy, modify, merge, publish, 
    13 # distribute, sublicense, and/or sell copies of the Software, and to 
    14 # permit persons to whom the Software is furnished to do so, subject to 
    15 # the following conditions: 
    16 # 
    17 # The above copyright notice and this permission notice shall be 
    18 # included in all copies or substantial portions of the Software. 
    19 # 
    20 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
    21 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
    22 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
    23 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 
    24 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
    25 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 
    26 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
    27 # 
    28 # Note: Originally licensed under LGPL v2+. Using MIT license for Rails 
    29 # with permission of Minero Aoki. 
    30 #++ 
    31  
    3232module TMail 
    3333 
     
    3636    module_function 
    3737 
    38     def rb_folding_encode( str, eol = "\n", limit = 60 ) 
     38    def folding_encode( str, eol = "\n", limit = 60 ) 
    3939      [str].pack('m') 
    4040    end 
    4141 
    42     def rb_encode( str ) 
     42    def encode( str ) 
    4343      [str].pack('m').tr( "\r\n", '' ) 
    4444    end 
    4545 
    46     def rb_decode( str, strict = false ) 
     46    def decode( str, strict = false ) 
    4747      str.unpack('m').first 
    48     end 
    49  
    50     begin 
    51       require 'tmail/base64.so' 
    52       alias folding_encode c_folding_encode 
    53       alias encode         c_encode 
    54       alias decode         c_decode 
    55       class << self 
    56         alias folding_encode c_folding_encode 
    57         alias encode         c_encode 
    58         alias decode         c_decode 
    59       end 
    60     rescue LoadError 
    61       alias folding_encode rb_folding_encode 
    62       alias encode         rb_encode 
    63       alias decode         rb_decode 
    64       class << self 
    65         alias folding_encode rb_folding_encode 
    66         alias encode         rb_encode 
    67         alias decode         rb_decode 
    68       end 
    6948    end 
    7049 
  • trunk/actionmailer/test/mail_service_test.rb

    r8238 r8257  
    853853  end 
    854854 
    855   def test_decode_message_with_unquoted_atchar_in_header 
    856     fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email11") 
    857     mail = TMail::Mail.parse(fixture) 
    858     assert_not_nil mail.from 
    859   end 
    860  
    861855  def test_empty_header_values_omitted 
    862856    result = TestMailer.create_unnamed_attachment(@recipient).encoded 
  • trunk/actionmailer/test/quoting_test.rb

    r7819 r8257  
    7171  end 
    7272   
    73   def test_rb_decode 
     73  def test_decode 
    7474    encoded, decoded = expected_base64_strings 
    75     assert_equal decoded, TMail::Base64.rb_decode(encoded) 
     75    assert_equal decoded, TMail::Base64.decode(encoded) 
    7676  end 
    7777   
    78   def test_rb_encode 
     78  def test_encode 
    7979    encoded, decoded = expected_base64_strings 
    80     assert_equal encoded.length, TMail::Base64.rb_encode(decoded).length 
    81   end 
    82    
    83   def test_rb_decode_should_match_c_decode_if_available 
    84     encoded, decoded = expected_base64_strings 
    85      
    86     begin 
    87       require 'tmail/base64.so' 
    88       assert_equal TMail::Base64.rb_decode(encoded), TMail::Base64.c_decode(encoded) 
    89     rescue LoadError 
    90       # No .so 
    91     end 
    92   end 
    93    
    94   def test_rb_encode_should_match_c_encode_if_available 
    95     encoded, decoded = expected_base64_strings 
    96      
    97     begin 
    98       require 'tmail/base64.so' 
    99       assert_equal TMail::Base64.rb_encode(decoded), TMail::Base64.c_encode(decoded) 
    100     rescue LoadError 
    101       # No .so 
    102     end 
     80    assert_equal encoded.length, TMail::Base64.encode(decoded).length 
    10381  end 
    10482