aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/test_case.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/test_case.rb')
-rw-r--r--activerecord/test/cases/test_case.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/test_case.rb b/activerecord/test/cases/test_case.rb
index 4476ce3410..cbf6ea36bf 100644
--- a/activerecord/test/cases/test_case.rb
+++ b/activerecord/test/cases/test_case.rb
@@ -19,6 +19,12 @@ module ActiveRecord
end
end
+ def capture_sql
+ SQLCounter.clear_log
+ yield
+ SQLCounter.log_all.dup
+ end
+
def assert_sql(*patterns_to_match)
SQLCounter.clear_log
yield