Browse files

fix Test::Mysqld.dsn

  • Loading branch information...
1 parent 7d8e4c5 commit 9bcd295e6539677cb9b48881979b3826f1b0ec6a miyucy committed May 19, 2011
Showing with 3 additions and 6 deletions.
  1. +3 −6 lib/test/mysqld.rb
View
9 lib/test/mysqld.rb
@@ -29,12 +29,9 @@ def initialize(options={})
def dsn(options={})
options.tap do |option|
- options[:port] ||= mycnf["port"] if mycnf["port"]
- if options[:port]
- options[:host] ||= mycnf["bind-address"] || "127.0.0.1"
- else
- options[:socket] ||= mycnf["socket"]
- end
+ options[:host] ||= mycnf["bind-address"] if mycnf["bind-address"]
+ options[:port] ||= mycnf["port"]
+ options[:socket] ||= mycnf["socket"]
options[:username] ||= "root"
options[:database] ||= self.class.database
end

0 comments on commit 9bcd295

Please sign in to comment.