Commit Graph

40 Commits

Author SHA1 Message Date
Rafael Mendonça França
3121412cf1 Keep quietly and capture undeprecated on your suite 2014-07-15 17:56:27 -03:00
Carlos Antonio da Silva
c5b76b5362 Prefer assert_raise instead of flunk + rescue to test for exceptions
Change most tests to make use of assert_raise returning the raised
exception rather than relying on a combination of flunk + rescue to
check for exception types/messages.
2013-12-19 09:20:51 -02:00
Vipul A M
7bae2921ec Change all MiniTest to Minitest since, MiniTest namespace has been renamed to Minitest
Ref: https://github.com/seattlerb/minitest/blob/master/History.txt
2013-12-18 14:39:50 +05:30
Xavier Noria
c7ac0a5b28 renames the :abort deprecation behaviour to :raise
That is a better name, thanks @jeremy.
2013-08-13 01:44:52 +02:00
Xavier Noria
73aad75f56 defines a new :abort deprecation behaviour that raises
See the CHANGELONG message in the patch for further details.
2013-08-13 01:27:18 +02:00
Akira Matsuda
ce0f977ae9 Test that DeprecatedConstantProxy does not warn when accessing its class 2013-01-23 13:29:40 +09:00
Akira Matsuda
4c5c98d0d3 Missing AS::Deprecation::DeprecatedObjectProxy test 2013-01-23 13:29:40 +09:00
Yves Senn
947e1d5e85 deprecate assert_blank and assert_present.
They don't add any benefits over `assert object.blank?`
and `assert object.present?`
2013-01-05 18:04:52 +01:00
Alexey Gaziev
b955939d55 Make caller attribute in deprecation methods optional 2012-10-30 10:23:41 +08:00
Piotr Niełacny
71993c6f97 Change ActiveSupport::Deprecation to class.
ActiveSupport::Deprecation is now a class rather than a module. You can
get instance of ActiveSupport::Deprecation calling #instance method.

  ActiveSupport::Deprecation.instance

But when you need to get new object od ActiveSupport::Deprecation you
need to just call #new.

  @instance = ActiveSupport::Deprecation.new

Since you can create a new object, you can change the version and the
name of the library where the deprecator concerned.

  ActiveSupport::Deprecation.new('2.0', 'MyGem')

If you need use another deprecator instance you can select it in the
options of deprecate method.

  deprecate :method, :deprecator => deprecator_instance

Documentation has been updated.
2012-09-13 08:42:00 +02:00
Robert Pankowecki
2c690a0f5b extend ActiveSupport::Deprecation with self, allow other objects to extend/include it also.
test local deprecation

deprecator object

Test ActiveSupport::Deprecation when included
2012-09-13 08:42:00 +02:00
Carlos Antonio da Silva
34599c4f57 Add test for default silence and stderr deprecation behaviors 2012-04-28 18:25:35 -03:00
Rafael Mendonça França
2fc3a30e17 Remove more references to Test::Unit 2012-01-06 15:36:36 -03:00
Rafael Mendonça França
3ca7fa96f7 Remove unneeded tests 2012-01-06 13:31:39 -03:00
Raghunadh
cd6ae26e8f fixed failing tests of ActiveSupport for deprecation test 2011-05-21 00:29:30 -07:00
Cyril Mougel
9024545a6b fix failure if behavior is not define and try use the default
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-01 12:17:21 +02:00
José Valim
e596a8e14c Add the possibility to have several behaviors in AS::Deprecation. 2010-07-01 10:26:45 +02:00
Yehuda Katz
ffb351713e Modify backtrace test to take implementations with slightly different backtrace output into consideration. 2009-12-13 10:40:00 -05:00
Michael Siebert
d811864e88 Fix deprecating =-methods by using send [#2431 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2009-08-09 15:54:56 +01:00
Jeremy Kemper
18099b0fd5 Rework testing extensions to reflect the recent miniunit upheaval 2008-11-07 12:45:48 -05:00
Jeremy Kemper
7b28a55a2b Remove direct TestCase mixins. Add miniunit compatibility. 2008-11-07 01:16:06 -05:00
Joshua Peek
c08547d226 Namespace Inflector, Dependencies, OrderedOptions, and TimeZone under ActiveSupport [#238 state:resolved] 2008-06-03 13:32:53 -05:00
Pratik Naik
2270371f5d Remove unnecessary DeprecatedInstanceVariable class 2008-05-13 10:39:45 +01:00
Pratik Naik
a53331a161 Add class to deprecate instance variables
Add ActiveSupport::Deprecation::DeprecatedInstanceVariable class to
deprecate instance variables of primitive types such as stings.
2008-05-06 11:52:44 +01:00
Jeremy Kemper
f6d8526659 require abstract_unit directly since test is in load path
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 13:31:04 +00:00
Jeremy Kemper
01452feff1 DeprecatedInstanceVariable#inspect doesn't warn since test/unit, error logs, and others use it for diagnostics.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5763 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-20 21:28:31 +00:00
Jeremy Kemper
8a73d4fe6f Deprecation: silence warnings when reporting test errors.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5728 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-17 08:21:45 +00:00
Jamis Buck
3a318970b1 Extend deprecate so that alternatives can be specified via the deprecation
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5356 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-24 16:56:59 +00:00
Jeremy Kemper
d0c000ab9e assert_deprecated returns result of block
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5115 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-15 05:54:18 +00:00
Jeremy Kemper
069b0eaf0b assert_deprecated matches any warning caught in block
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5114 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-15 03:56:25 +00:00
Jeremy Kemper
7269b086e1 silenced writer
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4978 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-04 05:55:55 +00:00
Jeremy Kemper
23d579b262 Quiet while testing, you.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4961 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-04 02:57:40 +00:00
Jeremy Kemper
29cec6d0ab get deprecation methods and callers straight
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4959 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-04 00:17:01 +00:00
Nicholas Seckar
30fa7053be Add silencing to deprecations; avoid self-scolding.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4760 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-14 18:15:44 +00:00
Nicholas Seckar
74165eb6ac New dependencies implementation
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4728 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-08 21:21:04 +00:00
Jeremy Kemper
0a44c85866 Include called method in instance variable deprecation warning.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-08 06:57:59 +00:00
Jeremy Kemper
2bf8f2307e Don't warn when the deprecated ivar proxy is instantiated.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4698 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-07 06:10:34 +00:00
Jeremy Kemper
0e73a92c04 DeprecatedInstanceVariableProxy stand-in for @request, @attributes, and friends.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-05 06:33:28 +00:00
Jeremy Kemper
7d01778139 Deprecation: easier to work with warning behavior as procs; default behaviors for each environment so users needn't update env.rb; and testing pleasure with assert_deprecated, assert_not_deprecated. Test prints to , dev logs, production ignores.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4647 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-01 11:12:38 +00:00
Michael Koziarski
7692191f5a Initial Version of Deprecation for Rails[Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4623 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-27 00:10:06 +00:00