mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
refactor assert_sql query to reuse capture_sql
set assert_sql to reuse the capture_sql method from above instead of repeating the code in response to comments on issue #14546
This commit is contained in:
parent
e9f53f7a7a
commit
49e17431ca
1 changed files with 1 additions and 3 deletions
|
@ -26,9 +26,7 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def assert_sql(*patterns_to_match)
|
def assert_sql(*patterns_to_match)
|
||||||
SQLCounter.clear_log
|
capture_sql { yield }
|
||||||
yield
|
|
||||||
SQLCounter.log_all
|
|
||||||
ensure
|
ensure
|
||||||
failed_patterns = []
|
failed_patterns = []
|
||||||
patterns_to_match.each do |pattern|
|
patterns_to_match.each do |pattern|
|
||||||
|
|
Loading…
Reference in a new issue