Skip to content
This repository
Browse code

Move BEGIN and COMMIT into IGNORED_SQL rather than having them as a s…

…pecial case in assert_queries
  • Loading branch information...
commit 5f43a2a2b127a2bbbbd9e8a1d56fadd2e7e11f59 1 parent b17fd25
Jon Leighton jonleighton authored
1  activerecord/lib/active_record/test_case.rb
@@ -46,7 +46,6 @@ def assert_queries(num = 1)
46 46 $queries_executed = []
47 47 yield
48 48 ensure
49   - %w{ BEGIN COMMIT }.each { |x| $queries_executed.delete(x) }
50 49 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")}"}"
51 50 end
52 51
2  activerecord/test/cases/helper.rb
@@ -57,7 +57,7 @@ def with_active_record_default_timezone(zone)
57 57
58 58 module ActiveRecord
59 59 class SQLCounter
60   - IGNORED_SQL = [/^PRAGMA (?!(table_info))/, /^SELECT currval/, /^SELECT CAST/, /^SELECT @@IDENTITY/, /^SELECT @@ROWCOUNT/, /^SAVEPOINT/, /^ROLLBACK TO SAVEPOINT/, /^RELEASE SAVEPOINT/, /^SHOW max_identifier_length/]
  60 + IGNORED_SQL = [/^PRAGMA (?!(table_info))/, /^SELECT currval/, /^SELECT CAST/, /^SELECT @@IDENTITY/, /^SELECT @@ROWCOUNT/, /^SAVEPOINT/, /^ROLLBACK TO SAVEPOINT/, /^RELEASE SAVEPOINT/, /^SHOW max_identifier_length/, /^BEGIN/, /^COMMIT/]
61 61
62 62 # FIXME: this needs to be refactored so specific database can add their own
63 63 # ignored SQL. This ignored SQL is for Oracle.

0 comments on commit 5f43a2a

Please sign in to comment.
Something went wrong with that request. Please try again.