diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-15 03:56:25 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-15 03:56:25 +0000 |
commit | 069b0eaf0bd42a2474028022b1e907dc97cc2e41 (patch) | |
tree | 4b7daa6e336713616783d345432fa31b268a8776 /activesupport/lib | |
parent | 643571ca25bc2fcc701e6def0975f56fe10a732f (diff) | |
download | rails-069b0eaf0bd42a2474028022b1e907dc97cc2e41.tar.gz rails-069b0eaf0bd42a2474028022b1e907dc97cc2e41.tar.bz2 rails-069b0eaf0bd42a2474028022b1e907dc97cc2e41.zip |
assert_deprecated matches any warning caught in block
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5114 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/deprecation.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/deprecation.rb b/activesupport/lib/active_support/deprecation.rb index 22a50f7e8b..e4e1d187a5 100644 --- a/activesupport/lib/active_support/deprecation.rb +++ b/activesupport/lib/active_support/deprecation.rb @@ -86,11 +86,11 @@ module ActiveSupport module Assertions def assert_deprecated(match = nil, &block) - last = collect_deprecations(&block).last - assert last, "Expected a deprecation warning within the block but received none" + warnings = collect_deprecations(&block) + assert !warnings.empty?, "Expected a deprecation warning within the block but received none" if match match = Regexp.new(Regexp.escape(match)) unless match.is_a?(Regexp) - assert_match match, last, "Deprecation warning didn't match #{match}: #{last}" + assert warnings.any? { |w| w =~ match }, "No deprecation warning matched #{match}: #{warnings.join(', ')}" end end |