Permalink
Browse files

! Deprecated ruby 1.8, 1.9, possibly 2.0, assert_send, & old MiniTest…

… namespace.

[git-p4: depot-paths = "//src/minitest/dev/": change = 10839]
  • Loading branch information...
1 parent f960538 commit f95ef007ec64d956d88fedc37fd2ed7e106b777e @zenspider zenspider committed Aug 18, 2016
Showing with 31 additions and 4 deletions.
  1. +15 −1 Rakefile
  2. +2 −0 lib/minitest/assertions.rb
  3. +14 −3 test/minitest/test_minitest_test.rb
View
@@ -11,7 +11,21 @@ Hoe.spec "minitest" do
license "MIT"
- self.testlib = :minitest
+ ## TODO: uncomment this on the last point release on 5.x
+ #
+ # self.post_install_message = <<-"EOM"
+ # NOTE: minitest 5 will be the last in the minitest family to support
+ # ruby 1.8 and 1.9 (and maybe 2.0?). If you need to keep using 1.8
+ # or 1.9, you need to pin your dependency to minitest with
+ # something like "~> 5.0".
+ #
+ # Further, minitest 6 will be dropping the following:
+ #
+ # + MiniTest (it's been Minitest for *years*)
+ # + MiniTest::Unit
+ # + MiniTest::Unit::TestCase
+ # + assert_send (unless you argue for it well)
+ # EOM
end
desc "Find missing expectations"
@@ -367,6 +367,8 @@ def assert_same exp, act, msg = nil
# Fails unless the call returns a true value
def assert_send send_ary, m = nil
+ warn "DEPRECATED: assert_send. From #{caller.first}"
+
recv, msg, *args = send_ary
m = message(m) {
"Expected #{mu_pp(recv)}.#{msg}(*#{mu_pp(args)}) to return true" }
@@ -1447,13 +1447,24 @@ def test_assert_same_triggered
end
end
+ def assert_deprecated name
+ dep = /DEPRECATED: #{name}. From #{__FILE__}:\d+:.*?/
+ assert_output nil, dep do
+ yield
+ end
+ end
+
def test_assert_send
- @tc.assert_send [1, :<, 2]
+ assert_deprecated :assert_send do
+ @tc.assert_send [1, :<, 2]
+ end
end
def test_assert_send_bad
- assert_triggered "Expected 1.>(*[2]) to return true." do
- @tc.assert_send [1, :>, 2]
+ assert_deprecated :assert_send do
+ assert_triggered "Expected 1.>(*[2]) to return true." do
+ @tc.assert_send [1, :>, 2]
+ end
end
end

0 comments on commit f95ef00

Please sign in to comment.