diff --git a/test/test_helper.rb b/test/test_helper.rb index 86f36b62..ed5df3b8 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -88,14 +88,11 @@ def count_queries(**subscribe_opts, &block) def assert_queries(num = 1, **subscribe_opts, &block) log = [] ret = subscribe_to_sql_queries(->(sql) { log << sql }, **subscribe_opts, &block) - assert_equal( - num, - log.size, - <<~MSG.squish - #{log.size} instead of #{num} queries were executed. - #{log.empty? ? "" : "\nQueries:\n#{log.join("\n")}"} - MSG - ) + + msg = "#{log.size} instead of #{num} queries were executed." + msg << "\nQueries:\n#{log.join("\n")}" unless log.empty? + + assert_equal(num, log.size, msg) ret end