Fixed- Machine dependent AR test cases #13527

Merged
merged 1 commit into from Dec 29, 2013

Conversation

Projects
None yet
2 participants
Contributor

kuldeepaggarwal commented Dec 29, 2013

This is a follow up to #13469, and #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: <Mysql2::Error>
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.

Contributor

kuldeepaggarwal commented Dec 29, 2013

Contributor

kuldeepaggarwal commented Dec 29, 2013

josevalim added a commit that referenced this pull request Dec 29, 2013

Merge pull request #13527 from kuldeepaggarwal/f-independent-specs
Use user-defined configurations in mysql tests

@josevalim josevalim merged commit 1072145 into rails:master Dec 29, 2013

1 check failed

default The Travis CI build failed
Details

@kuldeepaggarwal kuldeepaggarwal deleted the kuldeepaggarwal:f-independent-specs branch Dec 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment