diff options
author | Tarmo Tänav <tarmo@itech.ee> | 2008-08-26 13:41:41 +0300 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-08-26 12:45:04 +0200 |
commit | 3dfecfe77347421fbb54be70a5a84eb47c30acb6 (patch) | |
tree | d560c78e54e249ed31e0854c0475eef212c98ab6 /activerecord/lib | |
parent | bb557b44e9b0dc0dbb5ca7a4a8645f4af14f8021 (diff) | |
download | rails-3dfecfe77347421fbb54be70a5a84eb47c30acb6.tar.gz rails-3dfecfe77347421fbb54be70a5a84eb47c30acb6.tar.bz2 rails-3dfecfe77347421fbb54be70a5a84eb47c30acb6.zip |
Print the queries that were executed if assert_queries fails
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/test_case.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/test_case.rb b/activerecord/lib/active_record/test_case.rb index ca5591ae35..ffaa41282f 100644 --- a/activerecord/lib/active_record/test_case.rb +++ b/activerecord/lib/active_record/test_case.rb @@ -37,7 +37,7 @@ module ActiveRecord $queries_executed = [] yield ensure - assert_equal num, $queries_executed.size, "#{$queries_executed.size} instead of #{num} queries were executed." + 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 def assert_no_queries(&block) |