aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/inflector_test.rb
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2006-03-15 21:05:10 +0000
committerJamis Buck <jamis@37signals.com>2006-03-15 21:05:10 +0000
commit6c95e9b14697a9527ab761d1a084f6bc61af56b9 (patch)
treef22570b4789e922f9605e5c5d52eaa4e04ad93b4 /activesupport/test/inflector_test.rb
parent6480d4974920ba3a22606770b49cb4140fa3ad40 (diff)
downloadrails-6c95e9b14697a9527ab761d1a084f6bc61af56b9.tar.gz
rails-6c95e9b14697a9527ab761d1a084f6bc61af56b9.tar.bz2
rails-6c95e9b14697a9527ab761d1a084f6bc61af56b9.zip
Enhance Inflector.underscore to convert '-' into '_' (as the inverse of Inflector.dasherize)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3877 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/inflector_test.rb')
-rw-r--r--activesupport/test/inflector_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index d3f4a7727e..12976a6d92 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -302,4 +302,10 @@ class InflectorTest < Test::Unit::TestCase
assert_equal(dasherized, Inflector.dasherize(underscored))
end
end
+
+ def test_underscore_as_reverse_of_dasherize
+ UnderscoresToDashes.each do |underscored, dasherized|
+ assert_equal(underscored, Inflector.underscore(Inflector.dasherize(underscored)))
+ end
+ end
end