aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/inflector_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/inflector_test.rb')
-rw-r--r--activesupport/test/inflector_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index a0764f6d6b..56bc6bb99f 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
require 'abstract_unit'
require 'active_support/inflector'
@@ -31,6 +32,14 @@ class InflectorTest < ActiveSupport::TestCase
assert_equal "", ActiveSupport::Inflector.pluralize("")
end
+ def test_pluralize_for_words_with_non_ascii_characters
+ ActiveSupport::Inflector.inflections do |inflect|
+ inflect.uncountable "猫"
+ end
+ assert_equal "猫", ActiveSupport::Inflector.pluralize("猫")
+ ActiveSupport::Inflector.inflections.uncountables.pop
+ end
+
ActiveSupport::Inflector.inflections.uncountable.each do |word|
define_method "test_uncountability_of_#{word}" do
assert_equal word, ActiveSupport::Inflector.singularize(word)