Permalink
Browse files

Merge pull request #14548 from eileencodes/refactor_capture_sql_in_tests

refactor assert_sql query to reuse capture_sql
  • Loading branch information...
2 parents e9f53f7 + 49e1743 commit f54dd28a34ad4204cb8af49fee2e20cb347bba16 @rafaelfranca rafaelfranca committed Apr 1, 2014
Showing with 1 addition and 3 deletions.
  1. +1 −3 activerecord/test/cases/test_case.rb
View
4 activerecord/test/cases/test_case.rb
@@ -26,9 +26,7 @@ def capture_sql
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|

0 comments on commit f54dd28

Please sign in to comment.