rails/rails — pull request #13527 by kuldeepaggarwal (2013-12-29 08:39:37+00:00)
Title: Fixed- Machine dependent AR test cases

This is a follow up to https://github.com/rails/rails/pull/13469, and https://github.com/rails/rails/pull/13478
When user tried to execute test cases(either for a particular adapter or for all adapters), like:

```
$rake test_mysql2

1) Failure:
MysqlConnectionTest#test_bad_connection [/Volumes/kd/projects/kd-rails/activerecord/test/cases/adapters/mysql2/connection_test.rb:17]:
[ActiveRecord::NoDatabaseError] exception expected, not
Class:
Message: <"Access denied for user 'root'@'localhost' (using password: NO)">
---Backtrace---
/Users/kd/.rvm/gems/ruby-1.9.3-p448/gems/mysql2-0.3.14/lib/mysql2/client.rb:67:in `connect'
/Users/kd/.rvm/gems/ruby-1.9.3-p448/gems/mysql2-0.3.14/lib/mysql2/client.rb:67:in `initialize'
/Volumes/kd/projects/kd-rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `new'
/Volumes/kd/projects/kd-rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `mysql2_connection'
/Volumes/kd/projects/kd-rails/activerecord/test/cases/adapters/mysql2/connection_test.rb:18:in `block in test_bad_connection'
---------------

```

then all the test cases passed except `test_bad_connection` test and it is because the user has configured custom password for the adapter. This PR uses `ActiveRecord::Base.configurations` for executing `test_bad_connection` test case.