diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-01-19 22:13:05 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-01-19 22:13:05 -0500 |
commit | 996aba341ace42393f4e2cd7c00489dac20f2bd3 (patch) | |
tree | d690442af2985f30cfe028b305a673dd7548b046 /activerecord/test | |
parent | f48a16bdb249ada93995ab3e37e19c34e64334fd (diff) | |
download | rails-996aba341ace42393f4e2cd7c00489dac20f2bd3.tar.gz rails-996aba341ace42393f4e2cd7c00489dac20f2bd3.tar.bz2 rails-996aba341ace42393f4e2cd7c00489dac20f2bd3.zip |
Don't use anonymous classes in connection tests
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapters/mysql/connection_test.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/activerecord/test/cases/adapters/mysql/connection_test.rb b/activerecord/test/cases/adapters/mysql/connection_test.rb index ffd6904aec..b67d70ede7 100644 --- a/activerecord/test/cases/adapters/mysql/connection_test.rb +++ b/activerecord/test/cases/adapters/mysql/connection_test.rb @@ -1,6 +1,9 @@ require "cases/helper" class MysqlConnectionTest < ActiveRecord::TestCase + class Klass < ActiveRecord::Base + end + def setup super @connection = ActiveRecord::Base.connection @@ -17,9 +20,8 @@ class MysqlConnectionTest < ActiveRecord::TestCase run_without_connection do |orig| ar_config = ARTest.connection_config['arunit'] url = "mysql://#{ar_config["username"]}@localhost/#{ar_config["database"]}" - klass = Class.new(ActiveRecord::Base) - klass.establish_connection(url) - assert_equal ar_config['database'], klass.connection.current_database + Klass.establish_connection(url) + assert_equal ar_config['database'], Klass.connection.current_database end end |