Changeset 5728
- Timestamp:
- 12/17/06 08:21:45 (2 years ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- 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/CHANGELOG
r5726 r5728 1 1 *SVN* 2 3 * Deprecation: silence warnings when reporting test errors. [Jeremy Kemper] 2 4 3 5 * Hash#slice(*keys) returns a new hash with only the given keys. #slice! replaces the hash with only the given keys. Works with HashWithIndifferentAccess also. [Jeremy Kemper] trunk/activesupport/lib/active_support/deprecation.rb
r5547 r5728 173 173 end 174 174 175 require 'test/unit' 176 175 177 module Test 176 178 module Unit … … 178 180 include ActiveSupport::Deprecation::Assertions 179 181 end 182 183 class Error # :nodoc: 184 # Silence warnings when reporting test errors. 185 def message_with_silenced_deprecation 186 ActiveSupport::Deprecation.silence do 187 message_without_silenced_deprecation 188 end 189 end 190 191 alias_method_chain :message, :silenced_deprecation 192 end 180 193 end 181 194 end trunk/activesupport/test/deprecation_test.rb
r5356 r5728 129 129 assert_deprecated(/you now need to do something extra for this one/) { @dtc.d } 130 130 end 131 132 def test_assertion_failed_error_doesnt_spout_deprecation_warnings 133 error_class = Class.new(StandardError) do 134 def message 135 ActiveSupport::Deprecation.warn 'warning in error message' 136 super 137 end 138 end 139 140 raise error_class.new('hmm') 141 142 rescue => e 143 error = Test::Unit::Error.new('testing ur doodz', e) 144 assert_not_deprecated { error.message } 145 assert_nil @last_message 146 end 131 147 end