diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-07-19 17:53:14 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-09-03 22:59:05 +0200 |
commit | 32a5b49911b88e8e410583d382e8253004abce50 (patch) | |
tree | 292bf3c88524241e8740b34a937937b08b3b00b0 /railties/test | |
parent | 939d4255e690bd0406179cad00836975273fd49e (diff) | |
download | rails-32a5b49911b88e8e410583d382e8253004abce50.tar.gz rails-32a5b49911b88e8e410583d382e8253004abce50.tar.bz2 rails-32a5b49911b88e8e410583d382e8253004abce50.zip |
Move singleton pattern to Railtie and remove Engine::Configurable and Application::Configurable in favor of unified Railtie::Configurable
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/configuration_test.rb | 13 | ||||
-rw-r--r-- | railties/test/railties/engine_test.rb | 8 |
2 files changed, 10 insertions, 11 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 2da695b78e..63d53fff90 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -26,18 +26,17 @@ module ApplicationTests FileUtils.rm_rf(new_app) if File.directory?(new_app) end - test "Rails::Application.instance is nil until app is initialized" do + test "Rails.application is nil until app is initialized" do require 'rails' - assert_nil Rails::Application.instance + assert_nil Rails.application require "#{app_path}/config/environment" - assert_equal AppTemplate::Application.instance, Rails::Application.instance + assert_equal AppTemplate::Application.instance, Rails.application end - test "Rails::Application responds to all instance methods" do + test "Rails.application responds to all instance methods" do require "#{app_path}/config/environment" - assert_respond_to Rails::Application, :routes_reloader - assert_equal Rails::Application.routes_reloader, Rails.application.routes_reloader - assert_equal Rails::Application.routes_reloader, AppTemplate::Application.routes_reloader + assert_respond_to Rails.application, :routes_reloader + assert_equal Rails.application.routes_reloader, AppTemplate::Application.routes_reloader end test "Rails::Application responds to paths" do diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 09f2b5baa0..e8675daef0 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -85,12 +85,12 @@ module RailtiesTest boot_rails - Rails::Application.routes.draw do |map| + Rails.application.routes.draw do |map| mount(Bukkits::Engine => "/bukkits") end env = Rack::MockRequest.env_for("/bukkits") - response = Rails::Application.call(env) + response = Rails.application.call(env) assert_equal "HELLO WORLD", response[2] end @@ -109,12 +109,12 @@ module RailtiesTest match "/foo" => lambda { |env| [200, {'Content-Type' => 'text/html'}, 'foo'] } end - Rails::Application.routes.draw do |map| + Rails.application.routes.draw do |map| mount(Bukkits::Engine => "/bukkits") end env = Rack::MockRequest.env_for("/bukkits/foo") - response = Rails::Application.call(env) + response = Rails.application.call(env) assert_equal "foo", response[2] end |