Permalink
Browse files

Adding .rvmrc and .bundle to .gitignore; fixing bug where mysql conne…

…ction would fail when port='' - needed to be nil if missing; adding tests to test for that
  • Loading branch information...
1 parent 7c5f40c commit b396cf7fb2652aa3f1abf60c4895679465323d21 wiseleyb committed May 11, 2011
Showing with 12 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +3 −0 lib/mysql2psql/mysql_reader.rb
  3. +7 −0 test/integration/mysql_reader_base_test.rb
View
@@ -2,3 +2,5 @@
configs
test/fixtures/test*.sql
pkg
+.rvmrc
+.bundle
@@ -163,6 +163,9 @@ def initialize(options)
options.mysqlhostname('localhost'), options.mysqlusername,
options.mysqlpassword, options.mysqldatabase,
options.mysqlport, options.mysqlsocket
+ @port = nil if @port == "" # for things like Amazon's RDS you don't have a port and connect fails with "" for a value
+ @sock = nil if @sock == ""
+ @flag = nil if @flag == ""
connect
end
@@ -32,4 +32,11 @@ def test_mysql_reconnect
reader.reconnect
end
end
+ def test_mysql_connection_without_port
+ assert_nothing_raised do
+ options.mysqlport = ""
+ options.mysqlsocket = ""
+ reader = Mysql2psql::MysqlReader.new(options)
+ end
+ end
end

0 comments on commit b396cf7

Please sign in to comment.