aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2010-02-15 10:20:11 -0600
committerJoshua Peek <josh@joshpeek.com>2010-02-15 10:20:11 -0600
commiteec2d301d4ce9df9c71c1a5aa63053eb970b6818 (patch)
tree760bf54f7802d3e4f76e2db5bc642bb52637b532 /railties
parent7cff54f5d3ae2e364f0d147ceb86ea701b21389c (diff)
downloadrails-eec2d301d4ce9df9c71c1a5aa63053eb970b6818.tar.gz
rails-eec2d301d4ce9df9c71c1a5aa63053eb970b6818.tar.bz2
rails-eec2d301d4ce9df9c71c1a5aa63053eb970b6818.zip
Fix test load paths for those not using bundler
Diffstat (limited to 'railties')
-rw-r--r--railties/Rakefile2
-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
5 files changed, 26 insertions, 13 deletions
diff --git a/railties/Rakefile b/railties/Rakefile
index f32a794544..d4b446bc24 100644
--- a/railties/Rakefile
+++ b/railties/Rakefile
@@ -1,4 +1,4 @@
-require File.expand_path('../../load_paths', __FILE__)
+require File.expand_path('../../bundler', __FILE__)
require 'rake'
require 'rake/testtask'
diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb
index aa66dbb9be..2ac165fc49 100644
--- a/railties/test/abstract_unit.rb
+++ b/railties/test/abstract_unit.rb
@@ -1,8 +1,13 @@
ORIG_ARGV = ARGV.dup
-require File.expand_path("../../../load_paths", __FILE__)
+require File.expand_path("../../../bundler", __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 56f45582c8..7ca605ec23 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
new file mode 100644
index 0000000000..bd8a674738
--- /dev/null
+++ b/railties/test/edge_rails.rb
@@ -0,0 +1,14 @@
+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 364dbd8e55..f3c1d64f7b 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('../../../../load_paths', __FILE__)
+ require File.expand_path('../../edge_rails', __FILE__)
end
end
end
@@ -208,18 +208,12 @@ Module.new do
end
FileUtils.mkdir(tmp_path)
- environment = File.expand_path('../../../../load_paths', __FILE__)
- if File.exist?("#{environment}.rb")
- require_environment = "-r #{environment}"
- end
+ environment = File.expand_path('../../edge_rails', __FILE__)
+ require_environment = "-r #{environment}"
`#{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|
- if require_environment
- f.puts "Dir.chdir('#{File.dirname(environment)}') do"
- f.puts " require '#{environment}'"
- f.puts "end"
- end
+ f.puts "require '#{environment}'"
f.puts "require 'rails/all'"
end
end