Skip to content

Instantly share code, notes, and snippets.

@croaky
Created August 9, 2009 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save croaky/164808 to your computer and use it in GitHub Desktop.
Save croaky/164808 to your computer and use it in GitHub Desktop.
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