diff options
author | eileencodes <eileencodes@gmail.com> | 2014-03-31 22:53:45 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2014-03-31 22:56:39 -0400 |
commit | 49e17431ca3de23d68f33b7976b0c9243b1cb36e (patch) | |
tree | a5d103fc753dbec8172aca2869000fdb1e3aee38 /activerecord | |
parent | e9f53f7a7a5c57838654aad9ee1d8b0086b685d7 (diff) | |
download | rails-49e17431ca3de23d68f33b7976b0c9243b1cb36e.tar.gz rails-49e17431ca3de23d68f33b7976b0c9243b1cb36e.tar.bz2 rails-49e17431ca3de23d68f33b7976b0c9243b1cb36e.zip |
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
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/test_case.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/test/cases/test_case.rb b/activerecord/test/cases/test_case.rb index cbf6ea36bf..803a054d7e 100644 --- a/activerecord/test/cases/test_case.rb +++ b/activerecord/test/cases/test_case.rb @@ -26,9 +26,7 @@ module ActiveRecord end def assert_sql(*patterns_to_match) - SQLCounter.clear_log - yield - SQLCounter.log_all + capture_sql { yield } ensure failed_patterns = [] patterns_to_match.each do |pattern| |