aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/inflector_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-11-23 20:43:06 +0000
committerJosé Valim <jose.valim@gmail.com>2011-11-23 20:43:06 +0000
commite62de52aa398341a29b7ecef4ec9f9df8e1743e2 (patch)
tree3a87677e000259ecc0ced6bc93afc03fea73493b /activesupport/test/inflector_test.rb
parentafd7140b66e7cb32e1be58d9e44489e6bcbde0dc (diff)
parentfd86a1b6b068df87164d5763bdcd4a323a1e76f4 (diff)
downloadrails-e62de52aa398341a29b7ecef4ec9f9df8e1743e2.tar.gz
rails-e62de52aa398341a29b7ecef4ec9f9df8e1743e2.tar.bz2
rails-e62de52aa398341a29b7ecef4ec9f9df8e1743e2.zip
Merge branch 'master' into serializers
Diffstat (limited to 'activesupport/test/inflector_test.rb')
-rw-r--r--activesupport/test/inflector_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index 5c956e0075..6b7e839e43 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -194,6 +194,20 @@ class InflectorTest < Test::Unit::TestCase
def test_demodulize
assert_equal "Account", ActiveSupport::Inflector.demodulize("MyApplication::Billing::Account")
+ assert_equal "Account", ActiveSupport::Inflector.demodulize("Account")
+ assert_equal "", ActiveSupport::Inflector.demodulize("")
+ end
+
+ def test_deconstantize
+ assert_equal "MyApplication::Billing", ActiveSupport::Inflector.deconstantize("MyApplication::Billing::Account")
+ assert_equal "::MyApplication::Billing", ActiveSupport::Inflector.deconstantize("::MyApplication::Billing::Account")
+
+ assert_equal "MyApplication", ActiveSupport::Inflector.deconstantize("MyApplication::Billing")
+ assert_equal "::MyApplication", ActiveSupport::Inflector.deconstantize("::MyApplication::Billing")
+
+ assert_equal "", ActiveSupport::Inflector.deconstantize("Account")
+ assert_equal "", ActiveSupport::Inflector.deconstantize("::Account")
+ assert_equal "", ActiveSupport::Inflector.deconstantize("")
end
def test_foreign_key