Created
August 9, 2009 16:16
-
-
Save croaky/164808 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/activesupport/test/deprecation_test.rb b/activesupport/test/deprecation_test.rb | |
index 27b1dce..95740c0 100644 | |
--- a/activesupport/test/deprecation_test.rb | |
+++ b/activesupport/test/deprecation_test.rb | |
@@ -31,6 +31,11 @@ class Deprecatee | |
A = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Deprecatee::A', 'Deprecatee::B::C') | |
end | |
+class Rails | |
+ def self.backtrace_cleaner | |
+ ActiveSupport::BacktraceCleaner.new | |
+ end | |
+end | |
class DeprecationTest < ActiveSupport::TestCase | |
def setup | |
@@ -110,7 +115,10 @@ class DeprecationTest < ActiveSupport::TestCase | |
def test_assert_deprecation_backtrace_is_cleaned | |
assert_deprecated(/called from test_assert_deprecation_backtrace_is_cleaned at (.)\/test\/deprecation_test.rb:(\d)/) do | |
- ActiveSupport::Deprecation.warn 'abc' | |
+ stub = ActiveSupport::BacktraceCleaner.new | |
+ Rails.stubs(:backtrace_cleaner).returns(stub) | |
+ stub.expects(:clean) | |
+ ActiveSupport::Deprecation.warn('abc') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment