diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-05-31 20:47:03 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-05-31 20:47:03 +0000 |
commit | 05a17dc6b57e77171976a009b331511eae95200f (patch) | |
tree | 587643079c814ac8c9f1bd8b82b42d92560a60a6 /activerecord/test | |
parent | f9cd92f4ee49c689f25dbe7da008fb298a5feb4f (diff) | |
download | rails-05a17dc6b57e77171976a009b331511eae95200f.tar.gz rails-05a17dc6b57e77171976a009b331511eae95200f.tar.bz2 rails-05a17dc6b57e77171976a009b331511eae95200f.zip |
Add a list of regexes assert_queries skips in the ActiveRecord test suite. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4385 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/abstract_unit.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/test/abstract_unit.rb b/activerecord/test/abstract_unit.rb index 29e4601fee..881d26fac8 100755 --- a/activerecord/test/abstract_unit.rb +++ b/activerecord/test/abstract_unit.rb @@ -56,9 +56,13 @@ end ActiveRecord::Base.connection.class.class_eval do cattr_accessor :query_count + + # Array of regexes of queries that are not counted against query_count + @@ignore_list = [/^SELECT currval/] + alias_method :execute_without_query_counting, :execute def execute_with_query_counting(sql, name = nil) - self.query_count += 1 + self.query_count += 1 unless @@ignore_list.any? { |r| sql =~ r } execute_without_query_counting(sql, name) end end |