ActiveSupport::LogSubscriber::TestHelper::MockLogger Ruby on Rails 5.1.2 Class ActiveSupport::LogSubscriber::TestHelper::MockLogger < Object activesupport/lib/active_support/log_subscriber/test_helper.rb Methods F flush L logged M method_missing N new Included Modules ActiveSupport::Logger::Severity Attributes [R] flush_count [RW] level Class Public methods new(level = DEBUG) Link Source: show | on GitHub # File activesupport/lib/active_support/log_subscriber/test_helper.rb, line 58 def initialize(level = DEBUG) @flush_count = 0 @level = level @logged = Hash.new { |h, k| h[k] = [] } end Instance Public methods flush() Link Source: show | on GitHub # File activesupport/lib/active_support/log_subscriber/test_helper.rb, line 76 def flush @flush_count += 1 end logged(level) Link Source: show | on GitHub # File activesupport/lib/active_support/log_subscriber/test_helper.rb, line 72 def logged(level) @logged[level].compact.map { |l| l.to_s.strip } end method_missing(level, message = nil) Link Source: show | on GitHub # File activesupport/lib/active_support/log_subscriber/test_helper.rb, line 64 def method_missing(level, message = nil) if block_given? @logged[level] << yield else @logged[level] << message end end