From ff8be66f249d49e82c8e1d04cb8cfbbc128deabe Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 8 Oct 2009 18:12:28 -0700 Subject: Finish porting over the initializers to the app object and fix all the tests --- railties/test/application/configuration_test.rb | 17 +++++++++++++++++ railties/test/application/generators_test.rb | 2 +- railties/test/generators/generators_test_helper.rb | 9 +++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 railties/test/application/configuration_test.rb (limited to 'railties/test') diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb new file mode 100644 index 0000000000..1bf59c2b8e --- /dev/null +++ b/railties/test/application/configuration_test.rb @@ -0,0 +1,17 @@ +require "isolation/abstract_unit" + +module ApplicationTests + class InitializerTest < Test::Unit::TestCase + include ActiveSupport::Testing::Isolation + + def setup + build_app + boot_rails + end + + test "the application root is set correctly" do + # require "#{app_path}/config/environment" + # assert_equal app_path, Rails.application.root + end + end +end \ No newline at end of file diff --git a/railties/test/application/generators_test.rb b/railties/test/application/generators_test.rb index 0d6eb4147a..0edb29483d 100644 --- a/railties/test/application/generators_test.rb +++ b/railties/test/application/generators_test.rb @@ -5,9 +5,9 @@ module ApplicationTests include ActiveSupport::Testing::Isolation def setup - require "rails/generators" build_app boot_rails + require "rails/generators" end test "generators default values" do diff --git a/railties/test/generators/generators_test_helper.rb b/railties/test/generators/generators_test_helper.rb index d917812383..7599bda8a2 100644 --- a/railties/test/generators/generators_test_helper.rb +++ b/railties/test/generators/generators_test_helper.rb @@ -8,12 +8,17 @@ else RAILS_ROOT = fixtures end +$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../../activemodel/lib" +$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../../activerecord/lib" +$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../../actionpack/lib" $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../lib" +# TODO: Fix this RAILS_ENV stuff +RAILS_ENV = 'test' +require "rails/core" require 'rails/generators' require 'rubygems' -$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../../activerecord/lib" -$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../../actionpack/lib" + require 'active_record' require 'action_dispatch' -- cgit v1.2.3