diff options
author | Daniel Schierbeck <dasch@zendesk.com> | 2013-05-10 16:21:59 +0200 |
---|---|---|
committer | Daniel Schierbeck <dasch@zendesk.com> | 2013-05-10 16:50:35 +0200 |
commit | a33d320cf4b57fabd9c299b09c217ee3955ecc77 (patch) | |
tree | f21afe2bf9633cfb28623c038cc68488119e9adc /activerecord/test/cases/explain_subscriber_test.rb | |
parent | 9d7a748a5174224ead4d44aedc3849d1d1e37b18 (diff) | |
download | rails-a33d320cf4b57fabd9c299b09c217ee3955ecc77.tar.gz rails-a33d320cf4b57fabd9c299b09c217ee3955ecc77.tar.bz2 rails-a33d320cf4b57fabd9c299b09c217ee3955ecc77.zip |
Don't try to EXPLAIN select_db calls
Diffstat (limited to 'activerecord/test/cases/explain_subscriber_test.rb')
-rw-r--r-- | activerecord/test/cases/explain_subscriber_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/explain_subscriber_test.rb b/activerecord/test/cases/explain_subscriber_test.rb index 7b852a625d..f929ddd79e 100644 --- a/activerecord/test/cases/explain_subscriber_test.rb +++ b/activerecord/test/cases/explain_subscriber_test.rb @@ -38,6 +38,13 @@ if ActiveRecord::Base.connection.supports_explain? end end + def test_collects_nothing_if_the_statement_is_only_partially_matched + with_queries([]) do |queries| + SUBSCRIBER.finish(:name => 'SQL', :sql => 'select_db yo_mama') + assert queries.empty? + end + end + def test_collects_nothing_if_unexplained_sqls with_queries([]) do |queries| SUBSCRIBER.call(:name => 'SQL', :sql => 'SHOW max_identifier_length') |