diff options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/abstract_unit.rb | 5 | ||||
-rw-r--r-- | railties/test/generators/generators_test_helper.rb | 6 | ||||
-rw-r--r-- | railties/test/initializer/test_helper.rb | 15 | ||||
-rw-r--r-- | railties/test/rails_info_test.rb | 3 |
4 files changed, 20 insertions, 9 deletions
diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb index 9a640bdbc5..ea6ed01c7d 100644 --- a/railties/test/abstract_unit.rb +++ b/railties/test/abstract_unit.rb @@ -1,5 +1,9 @@ ORIG_ARGV = ARGV.dup +require 'rubygems' +gem 'rack', '~> 1.0.0' +gem 'rack-test', '~> 0.4.2' + $:.unshift File.dirname(__FILE__) + "/../../activesupport/lib" $:.unshift File.dirname(__FILE__) + "/../../activerecord/lib" $:.unshift File.dirname(__FILE__) + "/../../actionpack/lib" @@ -9,7 +13,6 @@ $:.unshift File.dirname(__FILE__) + "/../lib" $:.unshift File.dirname(__FILE__) + "/../builtin/rails_info" require 'stringio' -require 'rubygems' require 'test/unit' require 'active_support' diff --git a/railties/test/generators/generators_test_helper.rb b/railties/test/generators/generators_test_helper.rb index a258574dce..2a9d680c6a 100644 --- a/railties/test/generators/generators_test_helper.rb +++ b/railties/test/generators/generators_test_helper.rb @@ -9,10 +9,12 @@ else end $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../lib" +require 'generators' + +require 'rubygems' $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../../activerecord/lib" $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../../actionpack/lib" -require 'generators' -require 'activerecord' +require 'active_record' require 'action_dispatch' CURRENT_PATH = File.expand_path(Dir.pwd) diff --git a/railties/test/initializer/test_helper.rb b/railties/test/initializer/test_helper.rb index 9d7dfff1c0..f6a2547efc 100644 --- a/railties/test/initializer/test_helper.rb +++ b/railties/test/initializer/test_helper.rb @@ -2,13 +2,16 @@ # boot from scratch in vendored mode. This file should really only be # required in test cases that use the isolation helper so that requires # can be reset correctly. -RAILS_ROOT = File.join(File.dirname(__FILE__), "root") -RAILS_FRAMEWORK_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..')) +RAILS_ROOT = "#{File.dirname(__FILE__)}/root" +RAILS_FRAMEWORK_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../../..") + +require 'rubygems' +gem 'rack', '~> 1.0.0' require "test/unit" # We are purposely avoiding adding things to the load path to catch bugs that only happen in the genuine article -require File.join(RAILS_FRAMEWORK_ROOT, 'activesupport', 'lib', 'active_support', 'testing', 'isolation') -require File.join(RAILS_FRAMEWORK_ROOT, 'activesupport', 'lib', 'active_support', 'testing', 'declarative') +require "#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/testing/isolation" +require "#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/testing/declarative" class Test::Unit::TestCase extend ActiveSupport::Testing::Declarative @@ -35,7 +38,7 @@ module Rails def boot! # Require the initializer - require File.join(RAILS_FRAMEWORK_ROOT, 'railties', 'lib', 'initializer') + require "#{RAILS_FRAMEWORK_ROOT}/railties/lib/initializer" # Run the initializer the same way boot.rb does it Rails::Initializer.run(:install_gem_spec_stubs) Rails::GemDependency.add_frozen_gem_path @@ -45,4 +48,4 @@ module Rails end # All that for this: -Rails.boot!
\ No newline at end of file +Rails.boot! diff --git a/railties/test/rails_info_test.rb b/railties/test/rails_info_test.rb index fdcc7a1ef6..568e2a9972 100644 --- a/railties/test/rails_info_test.rb +++ b/railties/test/rails_info_test.rb @@ -3,6 +3,9 @@ $:.unshift File.dirname(__FILE__) + "/../builtin/rails_info" $:.unshift File.dirname(__FILE__) + "/../../activesupport/lib" $:.unshift File.dirname(__FILE__) + "/../../actionpack/lib" +require 'rubygems' +gem 'rack', '~> 1.0.0' + require 'test/unit' require 'active_support' require 'active_support/test_case' |