aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
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 /activemodel
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 'activemodel')
-rwxr-xr-xactivemodel/Rakefile2
-rw-r--r--activemodel/test/cases/helper.rb7
-rw-r--r--activemodel/test/cases/tests_database.rb4
3 files changed, 10 insertions, 3 deletions
diff --git a/activemodel/Rakefile b/activemodel/Rakefile
index 14c02f183f..556ea2ec0b 100755
--- a/activemodel/Rakefile
+++ b/activemodel/Rakefile
@@ -13,7 +13,7 @@ require 'rake/testtask'
task :default => :test
Rake::TestTask.new do |t|
- t.libs << "#{dir}/test"
+ t.libs << "test"
t.test_files = Dir.glob("#{dir}/test/cases/**/*_test.rb").sort
t.warning = true
end
diff --git a/activemodel/test/cases/helper.rb b/activemodel/test/cases/helper.rb
index 8bcbe54651..8b1ab9e196 100644
--- a/activemodel/test/cases/helper.rb
+++ b/activemodel/test/cases/helper.rb
@@ -1,4 +1,9 @@
-require File.expand_path('../../../../load_paths', __FILE__)
+require File.expand_path('../../../../bundler', __FILE__)
+
+lib = File.expand_path("#{File.dirname(__FILE__)}/../../lib")
+$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
+
+puts $LOAD_PATH.inspect
require 'config'
require 'active_model'
diff --git a/activemodel/test/cases/tests_database.rb b/activemodel/test/cases/tests_database.rb
index 8ca54d2678..4a392f609f 100644
--- a/activemodel/test/cases/tests_database.rb
+++ b/activemodel/test/cases/tests_database.rb
@@ -1,6 +1,8 @@
require 'logger'
-$:.unshift(File.dirname(__FILE__) + '/../../../activerecord/lib')
+activerecord_path = File.expand_path('../../../../activerecord/lib', __FILE__)
+$:.unshift(activerecord_path) if File.directory?(activerecord_path) && !$:.include?(activerecord_path)
+
require 'active_record'
module ActiveModel