aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-01-19 03:03:38 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2008-01-19 03:03:38 +0000
commitabfab89fd824a4fab9d1415efaec87ee2f48aa50 (patch)
treec9978b4c955e0abdde396fe2f97d1c4ed89da241 /actionmailer/test
parent52876c601067e96a01aab6525417e3aa1965807e (diff)
downloadrails-abfab89fd824a4fab9d1415efaec87ee2f48aa50.tar.gz
rails-abfab89fd824a4fab9d1415efaec87ee2f48aa50.tar.bz2
rails-abfab89fd824a4fab9d1415efaec87ee2f48aa50.zip
Ruby 1.9 compat: test encoding fixes. Closes #10597 [murphy]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/quoting_test.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionmailer/test/quoting_test.rb b/actionmailer/test/quoting_test.rb
index 35a88705fd..6d4c891b78 100644
--- a/actionmailer/test/quoting_test.rb
+++ b/actionmailer/test/quoting_test.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
require 'abstract_unit'
require 'tmail'
require 'tempfile'
@@ -38,11 +39,14 @@ class QuotingTest < Test::Unit::TestCase
def test_unqoute_iso
a ="=?ISO-8859-1?Q?Brosch=FCre_Rand?="
b = TMail::Unquoter.unquote_and_convert_to(a, 'iso-8859-1')
- assert_equal "Brosch\374re Rand", b
+ expected = "Brosch\374re Rand"
+ expected.force_encoding 'iso-8859-1' if expected.respond_to?(:force_encoding)
+ assert_equal expected, b
end
def test_quote_multibyte_chars
original = "\303\246 \303\270 and \303\245"
+ original.force_encoding nil if original.respond_to?(:force_encoding)
result = execute_in_sandbox(<<-CODE)
$:.unshift(File.dirname(__FILE__) + "/../lib/")