1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Print the queries that were executed if assert_queries fails

This commit is contained in:
Tarmo Tänav 2008-08-26 13:41:41 +03:00 committed by Michael Koziarski
parent bb557b44e9
commit 3dfecfe773

View file

@ -37,7 +37,7 @@ module ActiveRecord
$queries_executed = []
yield
ensure
assert_equal num, $queries_executed.size, "#{$queries_executed.size} instead of #{num} queries were executed."
assert_equal num, $queries_executed.size, "#{$queries_executed.size} instead of #{num} queries were executed.#{$queries_executed.size == 0 ? '' : "\nQueries:\n#{$queries_executed.join("\n")}"}"
end
def assert_no_queries(&block)