Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ensure blocks given to subscriber are properly yield

  • Loading branch information...
commit 313f292e27bfb093a59b8aee4d606f2c63391c7c 1 parent 6057a1d
@josevalim josevalim authored
View
9 activesupport/lib/active_support/log_subscriber/test_helper.rb
@@ -61,11 +61,12 @@ def initialize(level = DEBUG)
@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)
View
2  activesupport/test/log_subscriber_test.rb
@@ -11,7 +11,7 @@ def some_event(event)
def foo(event)
debug "debug"
- info "info"
+ info { "info" }
warn "warn"
end
Please sign in to comment.
Something went wrong with that request. Please try again.