Module | ActiveSupport::Deprecation::Assertions |
In: |
vendor/rails/activesupport/lib/active_support/deprecation.rb
|
# File vendor/rails/activesupport/lib/active_support/deprecation.rb, line 88 88: def assert_deprecated(match = nil, &block) 89: last = collect_deprecations(&block).last 90: assert last, "Expected a deprecation warning within the block but received none" 91: if match 92: match = Regexp.new(Regexp.escape(match)) unless match.is_a?(Regexp) 93: assert_match match, last, "Deprecation warning didn't match #{match}: #{last}" 94: end 95: end
# File vendor/rails/activesupport/lib/active_support/deprecation.rb, line 97 97: def assert_not_deprecated(&block) 98: deprecations = collect_deprecations(&block) 99: assert deprecations.empty?, "Expected no deprecation warning within the block but received #{deprecations.size}: \n #{deprecations * "\n "}" 100: end