diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2010-02-11 09:01:33 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-02-11 09:01:52 -0800 |
commit | 8afcd33246868af0b3f1888b38ae72a1f489f77e (patch) | |
tree | c121c1f8a06a9688b6afc966292947f33ad4a5bc /railties/lib | |
parent | 523002fe16366be69e830fd80bbd3d743d66fa16 (diff) | |
download | rails-8afcd33246868af0b3f1888b38ae72a1f489f77e.tar.gz rails-8afcd33246868af0b3f1888b38ae72a1f489f77e.tar.bz2 rails-8afcd33246868af0b3f1888b38ae72a1f489f77e.zip |
Resolve test/unit load ordering by removing backtrace filter from boot initializers
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/generators/rails/app/templates/test/test_helper.rb | 3 | ||||
-rw-r--r-- | railties/lib/rails/test_help.rb | 6 | ||||
-rw-r--r-- | railties/lib/rails/test_unit/railtie.rb | 10 |
3 files changed, 8 insertions, 11 deletions
diff --git a/railties/lib/generators/rails/app/templates/test/test_helper.rb b/railties/lib/generators/rails/app/templates/test/test_helper.rb index 005149eba0..8bf1192ffe 100644 --- a/railties/lib/generators/rails/app/templates/test/test_helper.rb +++ b/railties/lib/generators/rails/app/templates/test/test_helper.rb @@ -1,6 +1,5 @@ ENV["RAILS_ENV"] = "test" -require 'test/unit' -require File.expand_path(File.dirname(__FILE__) + "/../config/environment") +require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' class ActiveSupport::TestCase diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb index 350d0b3961..f9aa018cab 100644 --- a/railties/lib/rails/test_help.rb +++ b/railties/lib/rails/test_help.rb @@ -5,6 +5,12 @@ exit("Abort testing: Your Rails environment is not running in test mode!") unles require 'test/unit' require 'active_support/core_ext/kernel/requires' +# TODO: Figure out how to get the Rails::BacktraceFilter into minitest/unit +if defined?(Test::Unit::Util::BacktraceFilter) && ENV['BACKTRACE'].nil? + require 'rails/backtrace_cleaner' + Test::Unit::Util::BacktraceFilter.module_eval { include Rails::BacktraceFilterForTestUnit } +end + if defined?(ActiveRecord) class ActiveSupport::TestCase include ActiveRecord::TestFixtures diff --git a/railties/lib/rails/test_unit/railtie.rb b/railties/lib/rails/test_unit/railtie.rb index b0a4b460af..d99325a6d8 100644 --- a/railties/lib/rails/test_unit/railtie.rb +++ b/railties/lib/rails/test_unit/railtie.rb @@ -13,13 +13,5 @@ module Rails rake_tasks do load "rails/test_unit/testing.rake" end - - initializer "test_unit.backtrace_cleaner" do - # TODO: Figure out how to get the Rails::BacktraceFilter into minitest/unit - if defined?(Test::Unit::Util::BacktraceFilter) && ENV['BACKTRACE'].nil? - require 'rails/backtrace_cleaner' - Test::Unit::Util::BacktraceFilter.module_eval { include Rails::BacktraceFilterForTestUnit } - end - end end -end
\ No newline at end of file +end |