aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-05-17 08:52:40 +0200
committerJosé Valim <jose.valim@gmail.com>2012-05-17 08:52:40 +0200
commit313f292e27bfb093a59b8aee4d606f2c63391c7c (patch)
tree48e19dea03f3a6ef726d0ea2752c1ed6ec466a36 /activesupport/lib/active_support
parent6057a1d9d2522e27e8c9f2f44aab8cd2815f24da (diff)
downloadrails-313f292e27bfb093a59b8aee4d606f2c63391c7c.tar.gz
rails-313f292e27bfb093a59b8aee4d606f2c63391c7c.tar.bz2
rails-313f292e27bfb093a59b8aee4d606f2c63391c7c.zip
Ensure blocks given to subscriber are properly yield
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/log_subscriber/test_helper.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/log_subscriber/test_helper.rb b/activesupport/lib/active_support/log_subscriber/test_helper.rb
index 6e1502989b..9d01dc85c0 100644
--- a/activesupport/lib/active_support/log_subscriber/test_helper.rb
+++ b/activesupport/lib/active_support/log_subscriber/test_helper.rb
@@ -61,11 +61,12 @@ module ActiveSupport
@logged = Hash.new { |h,k| h[k] = [] }
end
- def debug
- end
-
def method_missing(level, message)
- @logged[level] << message
+ if block_given?
+ @logged[level] << yield
+ else
+ @logged[level] << message
+ end
end
def logged(level)