aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/lib/active_support/callbacks.rb5
-rw-r--r--railties/test/application/test_test.rb17
2 files changed, 2 insertions, 20 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index ba9fb4ecce..2ebafa28dd 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -381,9 +381,8 @@ module ActiveSupport
name = __callback_runner_name(nil, symbol)
undef_method(name) if method_defined?(name)
- silence_warnings do
- runner_method = "_run_#{symbol}_callbacks"
- undef_method runner_method if method_defined?(runner_method)
+ runner_method = "_run_#{symbol}_callbacks"
+ unless private_method_defined?(runner_method)
class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
def #{runner_method}(key = nil, &blk)
self.class.__run_callback(key, :#{symbol}, self, &blk)
diff --git a/railties/test/application/test_test.rb b/railties/test/application/test_test.rb
index a06facc04b..aa55a3cf1e 100644
--- a/railties/test/application/test_test.rb
+++ b/railties/test/application/test_test.rb
@@ -27,23 +27,6 @@ module ApplicationTests
run_test_file 'unit/foo_test.rb'
end
- # Run just in Ruby < 1.9
- if defined?(Test::Unit::Util::BacktraceFilter)
- test "adds backtrace cleaner" do
- app_file 'test/unit/backtrace_test.rb', <<-RUBY
- require 'test_helper'
-
- class FooTest < ActiveSupport::TestCase
- def test_truth
- assert Test::Unit::Util::BacktraceFilter.ancestors.include?(Rails::BacktraceFilterForTestUnit)
- end
- end
- RUBY
-
- run_test_file 'unit/backtrace_test.rb'
- end
- end
-
test "integration test" do
controller 'posts', <<-RUBY
class PostsController < ActionController::Base