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.rb22
1 files changed, 9 insertions, 13 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index b9e299af75..6484811d34 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -10,7 +10,7 @@ module Ace
end
end
-class InflectorTest < Test::Unit::TestCase
+class InflectorTest < ActiveSupport::TestCase
include InflectorTestCases
def test_pluralize_plurals
@@ -248,12 +248,6 @@ class InflectorTest < Test::Unit::TestCase
end
end
- def test_classify_with_symbol
- assert_nothing_raised do
- assert_equal 'FooBar', ActiveSupport::Inflector.classify(:foo_bars)
- end
- end
-
def test_classify_with_leading_schema_name
assert_equal 'FooBar', ActiveSupport::Inflector.classify('schema.foo_bar')
end
@@ -319,12 +313,6 @@ class InflectorTest < Test::Unit::TestCase
end
end
- def test_symbol_to_lower_camel
- SymbolToLowerCamel.each do |symbol, lower_camel|
- assert_equal(lower_camel, ActiveSupport::Inflector.camelize(symbol, false))
- end
- end
-
%w{plurals singulars uncountables humans}.each do |inflection_type|
class_eval <<-RUBY, __FILE__, __LINE__ + 1
def test_clear_#{inflection_type}
@@ -380,6 +368,14 @@ class InflectorTest < Test::Unit::TestCase
ActiveSupport::Inflector.inflections.instance_variable_set :@humans, cached_values[3]
end
+ [:pluralize, :singularize, :camelize, :underscore, :humanize, :titleize, :tableize, :classify, :dasherize, :demodulize].each do |method|
+ test "should deprecate symbols on #{method}" do
+ assert_deprecated(/Using symbols in inflections is deprecated/) do
+ ActiveSupport::Inflector.send(method, :foo)
+ end
+ end
+ end
+
Irregularities.each do |irregularity|
singular, plural = *irregularity
ActiveSupport::Inflector.inflections do |inflect|