Skip to content

Commit

Permalink
Move BEGIN and COMMIT into IGNORED_SQL rather than having them as a s…
Browse files Browse the repository at this point in the history
…pecial case in assert_queries
  • Loading branch information
jonleighton committed Jun 12, 2011
1 parent b17fd25 commit 5f43a2a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion activerecord/lib/active_record/test_case.rb
Expand Up @@ -46,7 +46,6 @@ def assert_queries(num = 1)
$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

Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/cases/helper.rb
Expand Up @@ -57,7 +57,7 @@ def with_active_record_default_timezone(zone)

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.
Expand Down

0 comments on commit 5f43a2a

Please sign in to comment.