Permalink
Browse files

deprecate AS core_ext/kernel/requires in 3.1

  • Loading branch information...
1 parent 65f54a6 commit d79e2846da5e44dc1700134e14f7b060ce43984d @joshk joshk committed May 23, 2011
@@ -1,4 +1,5 @@
require 'active_support/core_ext/kernel/reporting'
+require 'active_support/core_ext/module/deprecation'
module Kernel
# Require a library with fallback to RubyGems. Warnings during library
@@ -23,4 +24,5 @@ def require_library_or_gem(library_name)
end
end
end
+ deprecate :require_library_or_gem
end
@@ -1,7 +1,7 @@
require 'abstract_unit'
require 'active_support/core_ext/kernel'
-class KernelTest < Test::Unit::TestCase
+class KernelTest < ActiveSupport::TestCase
def test_silence_warnings
silence_warnings { assert_nil $VERBOSE }
assert_equal 1234, silence_warnings { 1234 }
@@ -52,11 +52,17 @@ def test_class_eval
class << o; @x = 1; end
assert_equal 1, o.class_eval { @x }
end
-
+
def test_capture
assert_equal 'STDERR', capture(:stderr) {$stderr.print 'STDERR'}
assert_equal 'STDOUT', capture(:stdout) {print 'STDOUT'}
end
+
+ def test_require_library_or_gem_deprecated
+ assert_deprecated do
+ require_library_or_gem 'i18n'
+ end
+ end
end
class KernelSuppressTest < Test::Unit::TestCase

0 comments on commit d79e284

Please sign in to comment.