Changeset 5763
- Timestamp:
- 12/20/06 21:28:31 (2 years ago)
- Files:
-
- trunk/activesupport/lib/active_support/deprecation.rb (modified) (2 diffs)
- trunk/activesupport/test/deprecation_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/lib/active_support/deprecation.rb
r5740 r5763 144 144 end 145 145 146 # Stand-in for @request, @attributes, etc. 146 # Stand-in for @request, @attributes, @params, etc which emits deprecation 147 # warnings on any method call (except #inspect). 147 148 class DeprecatedInstanceVariableProxy 148 149 instance_methods.each { |m| undef_method m unless m =~ /^__/ } … … 150 151 def initialize(instance, method, var = "@#{method}") 151 152 @instance, @method, @var = instance, method, var 153 end 154 155 # Don't give a deprecation warning on inspect since test/unit and error 156 # logs rely on it for diagnostics. 157 def inspect 158 target.inspect 152 159 end 153 160 trunk/activesupport/test/deprecation_test.rb
r5728 r5763 80 80 end 81 81 82 def test_deprecated_instance_variable_proxy_shouldnt_warn_on_inspect 83 assert_not_deprecated { assert_equal @dtc.request.inspect, @dtc.old_request.inspect } 84 end 85 82 86 def test_assert_deprecation_without_match 83 87 assert_deprecated do