diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-15 01:24:55 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-15 01:24:55 +0000 |
commit | 88a3343ed57c01ca358da8473d15fc4d2b4a5bff (patch) | |
tree | 3fe773bb113480f68eaea508d241cbaf90eebfde /activesupport/test | |
parent | 60f7a5cab73fab032fdb73d1a9a8061cf20031d2 (diff) | |
download | rails-88a3343ed57c01ca358da8473d15fc4d2b4a5bff.tar.gz rails-88a3343ed57c01ca358da8473d15fc4d2b4a5bff.tar.bz2 rails-88a3343ed57c01ca358da8473d15fc4d2b4a5bff.zip |
Backed out of routing merge.. investigating missing patches
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@616 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
6 files changed, 0 insertions, 102 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb index cdab0f9ed0..4523430ebe 100644 --- a/activesupport/test/inflector_test.rb +++ b/activesupport/test/inflector_test.rb @@ -1,13 +1,6 @@ require 'test/unit' require File.dirname(__FILE__) + '/../lib/inflector' -module A - module B - class C - end - end -end - class InflectorTest < Test::Unit::TestCase SingularToPlural = { "search" => "searches", @@ -57,12 +50,6 @@ class InflectorTest < Test::Unit::TestCase "SpecialGuest" => "special_guest", "ApplicationController" => "application_controller" } - - CamelWithModuleToUnderscoreWithSlash = { - "Admin::Product" => "admin/product", - "Users::Commission::Department" => "users/commission/department", - "UsersSection::CommissionDepartment" => "users_section/commission_department", - } ClassNameToForeignKeyWithUnderscore = { "Person" => "person_id", @@ -113,18 +100,6 @@ class InflectorTest < Test::Unit::TestCase assert_equal "html_tidy_generator", Inflector.underscore("HTMLTidyGenerator") end - def test_camelize_with_module - CamelWithModuleToUnderscoreWithSlash.each do |camel, underscore| - assert_equal(camel, Inflector.camelize(underscore)) - end - end - - def test_underscore_with_slashes - CamelWithModuleToUnderscoreWithSlash.each do |camel, underscore| - assert_equal(underscore, Inflector.underscore(camel)) - end - end - def test_demodulize assert_equal "Account", Inflector.demodulize("MyApplication::Billing::Account") end @@ -156,10 +131,4 @@ class InflectorTest < Test::Unit::TestCase assert_equal(human, Inflector.humanize(underscore)) end end - - def test_constantize - assert_equal A::B::C, Inflector.constantize("A::B::C") - assert_equal InflectorTest, Inflector.constantize("InflectorTest") - assert_raises(NameError) { Inflector.constantize("UnknownClass") } - end end
\ No newline at end of file diff --git a/activesupport/test/loading_module/admin/access_controller.rb b/activesupport/test/loading_module/admin/access_controller.rb deleted file mode 100644 index ddcbda8132..0000000000 --- a/activesupport/test/loading_module/admin/access_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Admin::AccessController -end diff --git a/activesupport/test/loading_module/admin/user_controller.rb b/activesupport/test/loading_module/admin/user_controller.rb deleted file mode 100644 index f265f1597a..0000000000 --- a/activesupport/test/loading_module/admin/user_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Admin::UserController -end diff --git a/activesupport/test/loading_module/content_controller.rb b/activesupport/test/loading_module/content_controller.rb deleted file mode 100644 index f0870161e5..0000000000 --- a/activesupport/test/loading_module/content_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class ContentController -end diff --git a/activesupport/test/loading_module/resource_controller.rb b/activesupport/test/loading_module/resource_controller.rb deleted file mode 100644 index d948f366bf..0000000000 --- a/activesupport/test/loading_module/resource_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class ResourceController -end diff --git a/activesupport/test/loading_module_tests.rb b/activesupport/test/loading_module_tests.rb deleted file mode 100644 index c1d8c7de62..0000000000 --- a/activesupport/test/loading_module_tests.rb +++ /dev/null @@ -1,63 +0,0 @@ -require 'test/unit' -require '../lib/core_ext.rb' -require '../lib/dependencies.rb' - -STAGING_DIRECTORY = 'loading_module' - -class LoadingModuleTests < Test::Unit::TestCase - def setup - @loading_module = Dependencies::LoadingModule.new(STAGING_DIRECTORY) - Object.const_set(:Controllers, @loading_module) - end - def teardown - @loading_module.clear - Object.send :remove_const, :Controllers - end - - def test_setup - assert_kind_of Dependencies::LoadingModule, @loading_module - end - - def test_const_available - assert @loading_module.const_available?(:Admin) - assert @loading_module.const_available?(:ResourceController) - assert @loading_module.const_available?(:ContentController) - assert @loading_module.const_available?("ContentController") - - assert_equal false, @loading_module.const_available?(:AdminController) - assert_equal false, @loading_module.const_available?(:RandomName) - end - - def test_const_load_module - assert @loading_module.const_load!(:Admin) - assert_kind_of Module, @loading_module::Admin - assert_kind_of Dependencies::LoadingModule, @loading_module::Admin - end - - def test_const_load_controller - assert @loading_module.const_load!(:ContentController) - assert_kind_of Class, @loading_module::ContentController - end - - def test_const_load_nested_controller - assert @loading_module.const_load!(:Admin) - assert @loading_module::Admin.const_available?(:UserController) - assert @loading_module::Admin.const_load!(:UserController) - assert_kind_of Class, @loading_module::Admin::UserController - end - - def test_pretty_access - assert_kind_of Module, @loading_module::Admin - assert_kind_of Dependencies::LoadingModule, @loading_module::Admin - - assert_kind_of Class, @loading_module::Admin::UserController - assert_kind_of Class, @loading_module::Admin::AccessController - assert_kind_of Class, @loading_module::ResourceController - assert_kind_of Class, @loading_module::ContentController - end - - def test_missing_name - assert_raises(NameError) {@loading_module::PersonController} - assert_raises(NameError) {@loading_module::Admin::FishController} - end -end
\ No newline at end of file |