diff options
author | José Valim <jose.valim@gmail.com> | 2011-09-08 20:49:08 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-09-08 20:54:30 +0200 |
commit | 6b010c2690de9ffce4878a9471c8adb33d4a21a1 (patch) | |
tree | b6f6053d93b64672334701a6ff3d5aae5d41dfa8 /activesupport/test/inflector_test.rb | |
parent | 0d254915819a9e5711895e410e1597177216c903 (diff) | |
download | rails-6b010c2690de9ffce4878a9471c8adb33d4a21a1.tar.gz rails-6b010c2690de9ffce4878a9471c8adb33d4a21a1.tar.bz2 rails-6b010c2690de9ffce4878a9471c8adb33d4a21a1.zip |
Revert removing gsub and sub from safe buffer.
Diffstat (limited to 'activesupport/test/inflector_test.rb')
-rw-r--r-- | activesupport/test/inflector_test.rb | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb index 6484811d34..b9e299af75 100644 --- a/activesupport/test/inflector_test.rb +++ b/activesupport/test/inflector_test.rb @@ -10,7 +10,7 @@ module Ace end end -class InflectorTest < ActiveSupport::TestCase +class InflectorTest < Test::Unit::TestCase include InflectorTestCases def test_pluralize_plurals @@ -248,6 +248,12 @@ class InflectorTest < ActiveSupport::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 @@ -313,6 +319,12 @@ class InflectorTest < ActiveSupport::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} @@ -368,14 +380,6 @@ class InflectorTest < ActiveSupport::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| |