From 697dda5f29acc1d9144770022b74aabb06f4cee0 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 14 Sep 2009 12:54:43 -0700 Subject: Fix deprecated gem-name requires --- railties/test/generators/generators_test_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/test') diff --git a/railties/test/generators/generators_test_helper.rb b/railties/test/generators/generators_test_helper.rb index a258574dce..e837fdb859 100644 --- a/railties/test/generators/generators_test_helper.rb +++ b/railties/test/generators/generators_test_helper.rb @@ -12,7 +12,7 @@ $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../lib" $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) -- cgit v1.2.3 From 4b8576a0c69f9d8497bfb47afcfca9f1832ea6a3 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 14 Sep 2009 12:56:53 -0700 Subject: Style bikeshed: prefer obvious string paths with / separator to args lists with ', ' separator --- railties/test/initializer/test_helper.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'railties/test') diff --git a/railties/test/initializer/test_helper.rb b/railties/test/initializer/test_helper.rb index 4cb9c1b814..f6a2547efc 100644 --- a/railties/test/initializer/test_helper.rb +++ b/railties/test/initializer/test_helper.rb @@ -2,16 +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 @@ -38,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 @@ -48,4 +48,4 @@ module Rails end # All that for this: -Rails.boot! \ No newline at end of file +Rails.boot! -- cgit v1.2.3 From d58ee2300854f4a5a4e0ff4b7e09f412eb2dc189 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 14 Sep 2009 13:04:24 -0700 Subject: Require rubygems in generators test so Action Dispatch can find rack --- railties/test/generators/generators_test_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'railties/test') diff --git a/railties/test/generators/generators_test_helper.rb b/railties/test/generators/generators_test_helper.rb index e837fdb859..2a9d680c6a 100644 --- a/railties/test/generators/generators_test_helper.rb +++ b/railties/test/generators/generators_test_helper.rb @@ -9,9 +9,11 @@ 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 'active_record' require 'action_dispatch' -- cgit v1.2.3