diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-06-12 17:29:53 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-06-12 18:19:21 +0100 |
commit | de01a6410207efd9554e9d1ed901c180e54d632a (patch) | |
tree | 0cfacdbed246813236754e922b38a3e16268a30f | |
parent | fa8dfad7654baa831c8de515118008b3382df515 (diff) | |
download | rails-de01a6410207efd9554e9d1ed901c180e54d632a.tar.gz rails-de01a6410207efd9554e9d1ed901c180e54d632a.tar.bz2 rails-de01a6410207efd9554e9d1ed901c180e54d632a.zip |
Move BEGIN and COMMIT into IGNORED_SQL rather than having them as a special case in assert_queries
-rw-r--r-- | activerecord/lib/active_record/test_case.rb | 1 | ||||
-rw-r--r-- | activerecord/test/cases/helper.rb | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/test_case.rb b/activerecord/lib/active_record/test_case.rb index c61428e104..9d8cd216ea 100644 --- a/activerecord/lib/active_record/test_case.rb +++ b/activerecord/lib/active_record/test_case.rb @@ -46,7 +46,6 @@ module ActiveRecord $queries_executed = [] yield ensure - %w{ BEGIN COMMIT }.each { |x| $queries_executed.delete(x) } 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")}"}" end diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb index d0dc9cb03d..85c20179ec 100644 --- a/activerecord/test/cases/helper.rb +++ b/activerecord/test/cases/helper.rb @@ -58,7 +58,7 @@ end module ActiveRecord class SQLCounter - IGNORED_SQL = [/^PRAGMA (?!(table_info))/, /^SELECT currval/, /^SELECT CAST/, /^SELECT @@IDENTITY/, /^SELECT @@ROWCOUNT/, /^SAVEPOINT/, /^ROLLBACK TO SAVEPOINT/, /^RELEASE SAVEPOINT/, /^SHOW max_identifier_length/] + 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/] # FIXME: this needs to be refactored so specific database can add their own # ignored SQL. This ignored SQL is for Oracle. |