diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-06-09 20:15:34 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-06-09 20:20:51 +0100 |
commit | 4b371b602b61cae5c3eed0ed6a5a2b0f92e4bbaf (patch) | |
tree | d6efbdf4a26bf0313a633573ff008eb2c9f1ccf4 /activerecord/test/cases | |
parent | e48829946d4002f6baffef21f401684d43ab9a35 (diff) | |
download | rails-4b371b602b61cae5c3eed0ed6a5a2b0f92e4bbaf.tar.gz rails-4b371b602b61cae5c3eed0ed6a5a2b0f92e4bbaf.tar.bz2 rails-4b371b602b61cae5c3eed0ed6a5a2b0f92e4bbaf.zip |
Print out information about whether the identity map is on or off when running unit tests
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/helper.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb index 110f6b97c6..d0dc9cb03d 100644 --- a/activerecord/test/cases/helper.rb +++ b/activerecord/test/cases/helper.rb @@ -12,19 +12,20 @@ require 'active_support/dependencies' require 'support/config' require 'support/connection' -ARTest.connect - # TODO: Move all these random hacks into the ARTest namespace and into the support/ dir # Show backtraces for deprecated behavior for quicker cleanup. ActiveSupport::Deprecation.debug = true -# Quote "type" if it's a reserved word for the current connection. -QUOTED_TYPE = ActiveRecord::Base.connection.quote_column_name('type') - # Enable Identity Map only when ENV['IM'] is set to "true" ActiveRecord::IdentityMap.enabled = (ENV['IM'] == "true") +# Connect to the database +ARTest.connect + +# Quote "type" if it's a reserved word for the current connection. +QUOTED_TYPE = ActiveRecord::Base.connection.quote_column_name('type') + def current_adapter?(*types) types.any? do |type| ActiveRecord::ConnectionAdapters.const_defined?(type) && |