diff options
author | Joshua Peek <josh@joshpeek.com> | 2010-02-15 10:20:11 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2010-02-15 10:20:11 -0600 |
commit | eec2d301d4ce9df9c71c1a5aa63053eb970b6818 (patch) | |
tree | 760bf54f7802d3e4f76e2db5bc642bb52637b532 /actionpack | |
parent | 7cff54f5d3ae2e364f0d147ceb86ea701b21389c (diff) | |
download | rails-eec2d301d4ce9df9c71c1a5aa63053eb970b6818.tar.gz rails-eec2d301d4ce9df9c71c1a5aa63053eb970b6818.tar.bz2 rails-eec2d301d4ce9df9c71c1a5aa63053eb970b6818.zip |
Fix test load paths for those not using bundler
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/abstract_unit.rb | 8 | ||||
-rw-r--r-- | actionpack/test/activerecord/controller_runtime_test.rb | 9 | ||||
-rw-r--r-- | actionpack/test/controller/subscriber_test.rb | 3 | ||||
-rw-r--r-- | actionpack/test/template/subscriber_test.rb | 5 |
4 files changed, 20 insertions, 5 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 867e50d5b9..655a133c96 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -1,4 +1,10 @@ -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) + +activemodel_path = File.expand_path('../../../activemodel/lib', __FILE__) +$:.unshift(activemodel_path) if File.directory?(activemodel_path) && !$:.include?(activemodel_path) $:.unshift(File.dirname(__FILE__) + '/lib') $:.unshift(File.dirname(__FILE__) + '/fixtures/helpers') diff --git a/actionpack/test/activerecord/controller_runtime_test.rb b/actionpack/test/activerecord/controller_runtime_test.rb index ed8e324938..f044e714d8 100644 --- a/actionpack/test/activerecord/controller_runtime_test.rb +++ b/actionpack/test/activerecord/controller_runtime_test.rb @@ -1,3 +1,6 @@ +railties_path = File.expand_path('../../../../railties/lib', __FILE__) +$:.unshift(railties_path) if File.directory?(railties_path) && !$:.include?(railties_path) + require 'active_record_unit' require 'active_record/railties/controller_runtime' require 'fixtures/project' @@ -12,7 +15,7 @@ class ControllerRuntimeSubscriberTest < ActionController::TestCase render :inline => "<%= Project.all %>" end end - + include Rails::Subscriber::TestHelper tests SubscriberController @@ -31,7 +34,7 @@ class ControllerRuntimeSubscriberTest < ActionController::TestCase def set_logger(logger) ActionController::Base.logger = logger end - + def test_log_with_active_record get :show wait @@ -39,4 +42,4 @@ class ControllerRuntimeSubscriberTest < ActionController::TestCase assert_equal 2, @logger.logged(:info).size assert_match /\(Views: [\d\.]+ms | ActiveRecord: [\d\.]+ms\)/, @logger.logged(:info)[1] end -end
\ No newline at end of file +end diff --git a/actionpack/test/controller/subscriber_test.rb b/actionpack/test/controller/subscriber_test.rb index d7c1166f14..72368df93b 100644 --- a/actionpack/test/controller/subscriber_test.rb +++ b/actionpack/test/controller/subscriber_test.rb @@ -1,3 +1,6 @@ +railties_path = File.expand_path('../../../../railties/lib', __FILE__) +$:.unshift(railties_path) if File.directory?(railties_path) && !$:.include?(railties_path) + require "abstract_unit" require "rails/subscriber/test_helper" require "action_controller/railties/subscriber" diff --git a/actionpack/test/template/subscriber_test.rb b/actionpack/test/template/subscriber_test.rb index 8bacab7088..8470f3c931 100644 --- a/actionpack/test/template/subscriber_test.rb +++ b/actionpack/test/template/subscriber_test.rb @@ -1,3 +1,6 @@ +railties_path = File.expand_path('../../../../railties/lib', __FILE__) +$:.unshift(railties_path) if File.directory?(railties_path) && !$:.include?(railties_path) + require "abstract_unit" require "rails/subscriber/test_helper" require "action_view/railties/subscriber" @@ -90,4 +93,4 @@ class AVSubscriberTest < ActiveSupport::TestCase assert_equal 1, @logger.logged(:info).size assert_match /Rendered collection/, @logger.logged(:info).last end -end
\ No newline at end of file +end |