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 | |
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')
-rw-r--r-- | activerecord/test/cases/helper.rb | 11 | ||||
-rw-r--r-- | activerecord/test/support/connection.rb | 2 |
2 files changed, 7 insertions, 6 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) && diff --git a/activerecord/test/support/connection.rb b/activerecord/test/support/connection.rb index fcd2e4dee5..a39794fa39 100644 --- a/activerecord/test/support/connection.rb +++ b/activerecord/test/support/connection.rb @@ -11,7 +11,7 @@ module ARTest end def self.connect - puts "Using #{connection_name}" + puts "Using #{connection_name} with Identity Map #{ActiveRecord::IdentityMap.enabled? ? 'on' : 'off'}" ActiveRecord::Base.logger = Logger.new("debug.log") ActiveRecord::Base.configurations = connection_config ActiveRecord::Base.establish_connection 'arunit' |