method
assert_queries
assert_queries(num = 1)
public
Hide source
# File activerecord/lib/active_record/test_case.rb, line 45 def assert_queries(num = 1) $queries_executed = [] yield ensure 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