aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing/pending.rb
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2011-04-05 21:22:38 +1000
committerRyan Bigg <radarlistener@gmail.com>2011-04-05 21:22:38 +1000
commit92e6255b58ce445d23580b669dac67d80e64d411 (patch)
treede3a01091787b30f1bafd462eedcb6210342493a /activesupport/lib/active_support/testing/pending.rb
parent357578256fb55e32ae87c6fbf22a1c19f59ce264 (diff)
parentac07da8fc72b7a57fd4a60c0dcb5b777d85f9eb7 (diff)
downloadrails-92e6255b58ce445d23580b669dac67d80e64d411.tar.gz
rails-92e6255b58ce445d23580b669dac67d80e64d411.tar.bz2
rails-92e6255b58ce445d23580b669dac67d80e64d411.zip
Merge branch 'master' of github.com:lifo/docrails
* 'master' of github.com:lifo/docrails: (57 commits) Made the defaults section a little more readable and more to the point, giving a overview of the possibilities. Added information about default values added .'s to headings in the initialization textile page s/ERb/ERB/g (part II) s/ERb/ERB/g Bump up erubis to 2.7.0 Implicit actions named not_implemented can be rendered Gem::Specification#has_rdoc= is deprecated since rubygems 1.7.0 default_executable is deprecated since rubygems 1.7.0 Trivial fix to HTTP Digest auth MD5 example Moved Turn activation/dependency to railties fix typo Direct logging of Active Record to STDOUT so it's shown inline with the results in the console [DHH] Add using Turn with natural language test case names if the library is available (which it will be in Rails 3.1) [DHH] require turn only for minitest Use Turn to format all Rails tests and enable the natural language case names Improve docs. pass respond_with options to controller render when using a template for api navigation only try to display an api template in responders if the request is a get or there are no errors when using respond_with with an invalid resource and custom options, the default response status and error messages should be returned ...
Diffstat (limited to 'activesupport/lib/active_support/testing/pending.rb')
-rw-r--r--activesupport/lib/active_support/testing/pending.rb46
1 files changed, 25 insertions, 21 deletions
diff --git a/activesupport/lib/active_support/testing/pending.rb b/activesupport/lib/active_support/testing/pending.rb
index 3d119e2fba..feac7bc347 100644
--- a/activesupport/lib/active_support/testing/pending.rb
+++ b/activesupport/lib/active_support/testing/pending.rb
@@ -11,32 +11,36 @@ module ActiveSupport
@@at_exit = false
def pending(description = "", &block)
- if description.is_a?(Symbol)
- is_pending = $tags[description]
- return block.call unless is_pending
- end
+ if defined?(::MiniTest)
+ skip(description.blank? ? nil : description)
+ else
+ if description.is_a?(Symbol)
+ is_pending = $tags[description]
+ return block.call unless is_pending
+ end
- if block_given?
- failed = false
+ if block_given?
+ failed = false
- begin
- block.call
- rescue Exception
- failed = true
- end
+ begin
+ block.call
+ rescue Exception
+ failed = true
+ end
- flunk("<#{description}> did not fail.") unless failed
- end
+ flunk("<#{description}> did not fail.") unless failed
+ end
- caller[0] =~ (/(.*):(.*):in `(.*)'/)
- @@pending_cases << "#{$3} at #{$1}, line #{$2}"
- print "P"
+ caller[0] =~ (/(.*):(.*):in `(.*)'/)
+ @@pending_cases << "#{$3} at #{$1}, line #{$2}"
+ print "P"
- @@at_exit ||= begin
- at_exit do
- puts "\nPending Cases:"
- @@pending_cases.each do |test_case|
- puts test_case
+ @@at_exit ||= begin
+ at_exit do
+ puts "\nPending Cases:"
+ @@pending_cases.each do |test_case|
+ puts test_case
+ end
end
end
end