From ddaa5d5181e8ed576c4a033062545b0d41a7da72 Mon Sep 17 00:00:00 2001 From: Daniel Schierbeck Date: Sat, 11 May 2013 16:14:49 +0200 Subject: Don't try to EXPLAIN select_db calls Now with a non-broken test. --- activerecord/test/cases/explain_subscriber_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activerecord/test/cases/explain_subscriber_test.rb') diff --git a/activerecord/test/cases/explain_subscriber_test.rb b/activerecord/test/cases/explain_subscriber_test.rb index 7b852a625d..0546e793fe 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.call(: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') -- cgit v1.2.3