diff options
Diffstat (limited to 'activesupport/lib/active_support/testing')
-rw-r--r-- | activesupport/lib/active_support/testing/assertions.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/testing/deprecation.rb | 18 | ||||
-rw-r--r-- | activesupport/lib/active_support/testing/pending.rb | 5 |
3 files changed, 16 insertions, 9 deletions
diff --git a/activesupport/lib/active_support/testing/assertions.rb b/activesupport/lib/active_support/testing/assertions.rb index ca51adba1e..c529b92240 100644 --- a/activesupport/lib/active_support/testing/assertions.rb +++ b/activesupport/lib/active_support/testing/assertions.rb @@ -1,3 +1,5 @@ +require 'active_support/core_ext/array/wrap' + module ActiveSupport module Testing module Assertions diff --git a/activesupport/lib/active_support/testing/deprecation.rb b/activesupport/lib/active_support/testing/deprecation.rb index e9220605bd..0135185a47 100644 --- a/activesupport/lib/active_support/testing/deprecation.rb +++ b/activesupport/lib/active_support/testing/deprecation.rb @@ -1,3 +1,5 @@ +require 'active_support/deprecation' + module ActiveSupport module Testing module Deprecation #:nodoc: @@ -35,21 +37,19 @@ end begin require 'test/unit/error' - +rescue LoadError + # Using miniunit, ignore. +else module Test module Unit - class Error # :nodoc: + class Error #:nodoc: # Silence warnings when reporting test errors. def message_with_silenced_deprecation - ActiveSupport::Deprecation.silence do - message_without_silenced_deprecation - end + ActiveSupport::Deprecation.silence { message_without_silenced_deprecation } end - - alias_method_chain :message, :silenced_deprecation + alias_method :message_without_silenced_deprecation, :message + alias_method :message, :message_with_silenced_deprecation end end end -rescue LoadError - # Using miniunit, ignore. end diff --git a/activesupport/lib/active_support/testing/pending.rb b/activesupport/lib/active_support/testing/pending.rb index d945c7e476..21134ff9e2 100644 --- a/activesupport/lib/active_support/testing/pending.rb +++ b/activesupport/lib/active_support/testing/pending.rb @@ -11,6 +11,11 @@ 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 block_given? failed = false |