aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-02-23 17:31:17 -0800
committerCarlhuda <carlhuda@engineyard.com>2010-02-23 17:31:17 -0800
commit24ab5665b2f12a589e96a4b742cc49c08bf0e9df (patch)
treecbc703c96affe65fe8f0b24c6b6241286c820ba8 /railties/test
parent5e2bd08023344f3fd4675e80203a10967ffe9000 (diff)
downloadrails-24ab5665b2f12a589e96a4b742cc49c08bf0e9df.tar.gz
rails-24ab5665b2f12a589e96a4b742cc49c08bf0e9df.tar.bz2
rails-24ab5665b2f12a589e96a4b742cc49c08bf0e9df.zip
Revert "Fix test load paths for those not using bundler"
This reverts commit eec2d301d4ce9df9c71c1a5aa63053eb970b6818. This commit broke tests. You cannot have a file called "bundler" on the load path.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/abstract_unit.rb7
-rw-r--r--railties/test/application/configuration_test.rb2
-rw-r--r--railties/test/edge_rails.rb14
-rw-r--r--railties/test/isolation/abstract_unit.rb14
4 files changed, 12 insertions, 25 deletions
diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb
index 2ac165fc49..aa66dbb9be 100644
--- a/railties/test/abstract_unit.rb
+++ b/railties/test/abstract_unit.rb
@@ -1,13 +1,8 @@
ORIG_ARGV = ARGV.dup
-require File.expand_path("../../../bundler", __FILE__)
+require File.expand_path("../../../load_paths", __FILE__)
$:.unshift File.expand_path("../../builtin/rails_info", __FILE__)
-lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
-$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
-
-require 'edge_rails'
-
require 'stringio'
require 'test/unit'
require 'fileutils'
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index 3e03a01ff3..acf752a448 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -140,7 +140,7 @@ module ApplicationTests
require "#{app_path}/config/environment"
end
end
-
+
test "filter_parameters should be able to set via config.filter_parameters" do
add_to_config <<-RUBY
config.filter_parameters += [ :foo, 'bar', lambda { |key, value|
diff --git a/railties/test/edge_rails.rb b/railties/test/edge_rails.rb
deleted file mode 100644
index bd8a674738..0000000000
--- a/railties/test/edge_rails.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require File.expand_path('../../../bundler', __FILE__)
-
-%w(
- actionmailer
- actionpack
- activemodel
- activerecord
- activeresource
- activesupport
- railties
-).each do |framework|
- framework_path = File.expand_path("../../../#{framework}/lib", __FILE__)
- $:.unshift(framework_path) if File.directory?(framework_path) && !$:.include?(framework_path)
-end
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index f3c1d64f7b..364dbd8e55 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -187,7 +187,7 @@ module TestHelpers
end
def boot_rails
- require File.expand_path('../../edge_rails', __FILE__)
+ require File.expand_path('../../../../load_paths', __FILE__)
end
end
end
@@ -208,12 +208,18 @@ Module.new do
end
FileUtils.mkdir(tmp_path)
- environment = File.expand_path('../../edge_rails', __FILE__)
- require_environment = "-r #{environment}"
+ environment = File.expand_path('../../../../load_paths', __FILE__)
+ if File.exist?("#{environment}.rb")
+ require_environment = "-r #{environment}"
+ end
`#{Gem.ruby} #{require_environment} #{RAILS_FRAMEWORK_ROOT}/railties/bin/rails #{tmp_path('app_template')}`
File.open("#{tmp_path}/app_template/config/boot.rb", 'w') do |f|
- f.puts "require '#{environment}'"
+ if require_environment
+ f.puts "Dir.chdir('#{File.dirname(environment)}') do"
+ f.puts " require '#{environment}'"
+ f.puts "end"
+ end
f.puts "require 'rails/all'"
end
end