From 6b010c2690de9ffce4878a9471c8adb33d4a21a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 8 Sep 2011 20:49:08 +0200 Subject: Revert removing gsub and sub from safe buffer. --- activesupport/test/inflector_test.rb | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'activesupport/test/inflector_test.rb') 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| -- cgit v1.2.3