diff options
author | Carlhuda <carlhuda@Carlhudas-iMac.local> | 2009-11-24 13:03:24 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@Carlhudas-iMac.local> | 2009-11-24 14:36:30 -0800 |
commit | 530b8ff5ae811e0dd5e1343b478f42eed6fffdbd (patch) | |
tree | bbff1bbfbf0c889a78ce6badf93aab0d1f6b2ed1 /railties/test | |
parent | a2cb90c0c246e772e9735ff59f5517e3dee313ff (diff) | |
download | rails-530b8ff5ae811e0dd5e1343b478f42eed6fffdbd.tar.gz rails-530b8ff5ae811e0dd5e1343b478f42eed6fffdbd.tar.bz2 rails-530b8ff5ae811e0dd5e1343b478f42eed6fffdbd.zip |
Have script/* and Rakefile use the application object
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/load_test.rb | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/railties/test/application/load_test.rb b/railties/test/application/load_test.rb index 3da51c4355..dc5d03b323 100644 --- a/railties/test/application/load_test.rb +++ b/railties/test/application/load_test.rb @@ -7,21 +7,8 @@ module ApplicationTests include ActiveSupport::Testing::Isolation def rackup - config = "#{app_path}/config.ru" - # Copied from ActionDispatch::Utils.parse_config - # ActionDispatch is not necessarily available at this point. - require 'rack' - if config =~ /\.ru$/ - cfgfile = ::File.read(config) - if cfgfile[/^#\\(.*)/] - opts.parse! $1.split(/\s+/) - end - inner_app = eval "Rack::Builder.new {( " + cfgfile + "\n )}.to_app", - nil, config - else - require config - inner_app = Object.const_get(::File.basename(config, '.rb').capitalize) - end + require "rack" + Rack::Builder.parse_file("#{app_path}/config.ru") end def setup @@ -40,14 +27,14 @@ module ApplicationTests test "Rails.application is available after config.ru has been racked up" do rackup - assert Rails.application < Rails::Application + assert Rails.application.is_a?(Rails::Application) end # Passenger still uses AC::Dispatcher, so we need to # keep it working for now test "deprecated ActionController::Dispatcher still works" do rackup - assert ActionController::Dispatcher.new < Rails::Application + assert ActionController::Dispatcher.new.is_a?(Rails::Application) end test "the config object is available on the application object" do |