mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Properly deprecate #pending from AS::TestCase
Check https://github.com/rails/rails/pull/4575#issuecomment-5765575.
This commit is contained in:
parent
4913984122
commit
92da512125
3 changed files with 10 additions and 8 deletions
|
@ -1,5 +1,7 @@
|
|||
## Rails 4.0.0 (unreleased) ##
|
||||
|
||||
* Deprecate `ActiveSupport::TestCase#pending` method, use `skip` from MiniTest instead. *Carlos Antonio da Silva*
|
||||
|
||||
* `XmlMini.with_backend` now may be safely used with threads:
|
||||
|
||||
Thread.new do
|
||||
|
|
|
@ -1,20 +1,14 @@
|
|||
# Some code from jeremymcanally's "pending"
|
||||
# https://github.com/jeremymcanally/pending/tree/master
|
||||
require 'active_support/deprecation'
|
||||
|
||||
module ActiveSupport
|
||||
module Testing
|
||||
module Pending
|
||||
|
||||
unless defined?(Spec)
|
||||
|
||||
@@pending_cases = []
|
||||
@@at_exit = false
|
||||
|
||||
def pending(description = "", &block)
|
||||
ActiveSupport::Deprecation.warn("#pending is deprecated and will be removed in Rails 4.1, please use #skip instead.")
|
||||
skip(description.blank? ? nil : description)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -108,5 +108,11 @@ module ActiveSupport
|
|||
test = tc.new test_name
|
||||
assert_raises(Interrupt) { test.run fr }
|
||||
end
|
||||
|
||||
def test_pending_deprecation
|
||||
assert_deprecated do
|
||||
pending "should use #skip instead"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue