Skip to content

Commit

Permalink
Properly deprecate #pending from AS::TestCase
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosantoniodasilva committed Nov 18, 2012
1 parent 4913984 commit 92da512
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions activesupport/CHANGELOG.md
@@ -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
Expand Down
10 changes: 2 additions & 8 deletions activesupport/lib/active_support/testing/pending.rb
@@ -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
6 changes: 6 additions & 0 deletions activesupport/test/test_case_test.rb
Expand Up @@ -108,5 +108,11 @@ def test_true; assert true end
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

0 comments on commit 92da512

Please sign in to comment.