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.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index d8c93dc9ae..6b9fbd3156 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -116,6 +116,12 @@ class InflectorTest < Test::Unit::TestCase
end
end
+ def test_parameterize_with_multi_character_separator
+ StringToParameterized.each do |some_string, parameterized_string|
+ assert_equal(parameterized_string.gsub('-', '__sep__'), ActiveSupport::Inflector.parameterize(some_string, '__sep__'))
+ end
+ end
+
def test_classify
ClassNameToTableName.each do |class_name, table_name|
assert_equal(class_name, ActiveSupport::Inflector.classify(table_name))
@@ -161,13 +167,13 @@ class InflectorTest < Test::Unit::TestCase
assert_nothing_raised { assert_equal Ace::Base::Case, ActiveSupport::Inflector.constantize("::Ace::Base::Case") }
assert_nothing_raised { assert_equal InflectorTest, ActiveSupport::Inflector.constantize("InflectorTest") }
assert_nothing_raised { assert_equal InflectorTest, ActiveSupport::Inflector.constantize("::InflectorTest") }
- assert_raises(NameError) { ActiveSupport::Inflector.constantize("UnknownClass") }
- assert_raises(NameError) { ActiveSupport::Inflector.constantize("An invalid string") }
- assert_raises(NameError) { ActiveSupport::Inflector.constantize("InvalidClass\n") }
+ assert_raise(NameError) { ActiveSupport::Inflector.constantize("UnknownClass") }
+ assert_raise(NameError) { ActiveSupport::Inflector.constantize("An invalid string") }
+ assert_raise(NameError) { ActiveSupport::Inflector.constantize("InvalidClass\n") }
end
def test_constantize_does_lexical_lookup
- assert_raises(NameError) { ActiveSupport::Inflector.constantize("Ace::Base::InflectorTest") }
+ assert_raise(NameError) { ActiveSupport::Inflector.constantize("Ace::Base::InflectorTest") }
end
def test_ordinal