https://github.com/rails/rails/blob/master/activesupport/lib/active_support/log_subscriber/test_helper.rb#L36
Basically I followed the testing logic from https://github.com/rails/rails/blob/master/activerecord/test/cases/log_subscriber_test.rb