aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2013-07-26 04:21:52 +0900
committerArun Agrawal <arunagw@gmail.com>2013-09-10 19:54:49 +0200
commite837e5a96b74086d6a4f2c82b30a63f2eca8f4a4 (patch)
tree9905f580778464d9fa62ff003111ea683208cbec /activesupport
parent3b7d8351f66c7169242f38aed99f4c60f152562f (diff)
downloadrails-e837e5a96b74086d6a4f2c82b30a63f2eca8f4a4.tar.gz
rails-e837e5a96b74086d6a4f2c82b30a63f2eca8f4a4.tar.bz2
rails-e837e5a96b74086d6a4f2c82b30a63f2eca8f4a4.zip
Be sure to restore the default I18n.locale after changed its value in a test
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/test/transliterate_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/test/transliterate_test.rb b/activesupport/test/transliterate_test.rb
index ce91c443e1..e0f85f4e7c 100644
--- a/activesupport/test/transliterate_test.rb
+++ b/activesupport/test/transliterate_test.rb
@@ -3,7 +3,6 @@ require 'abstract_unit'
require 'active_support/inflector/transliterate'
class TransliterateTest < ActiveSupport::TestCase
-
def test_transliterate_should_not_change_ascii_chars
(0..127).each do |byte|
char = [byte].pack("U")
@@ -24,12 +23,13 @@ class TransliterateTest < ActiveSupport::TestCase
def test_transliterate_should_work_with_custom_i18n_rules_and_uncomposed_utf8
char = [117, 776].pack("U*") # "ü" as ASCII "u" plus COMBINING DIAERESIS
I18n.backend.store_translations(:de, :i18n => {:transliterate => {:rule => {"ü" => "ue"}}})
- I18n.locale = :de
+ default_locale, I18n.locale = I18n.locale, :de
assert_equal "ue", ActiveSupport::Inflector.transliterate(char)
+ ensure
+ I18n.locale = default_locale
end
def test_transliterate_should_allow_a_custom_replacement_char
assert_equal "a*b", ActiveSupport::Inflector.transliterate("a索b", "*")
end
-
end