test/mock_logger.rb in semantic_logger-2.20.0 vs test/mock_logger.rb in semantic_logger-2.21.0
- old
+ new
@@ -3,14 +3,14 @@
class MockLogger
attr_accessor :message
Logger::Severity.constants.each do |level|
class_eval <<-EOT, __FILE__, __LINE__
- def #{level.downcase}(message = nil, progname = nil, &block)
+ def #{level.downcase}(message = nil, progname = nil)
if message
self.message = message
- elsif block
- self.message = block.call
+ elsif block_given?
+ self.message = yield
else
self.message = progname
end
self.message
end