Commits

Paul Gallagher committed 970e439

add base postgres db writer test

  • Participants
  • Parent commits 361613f

Comments (0)

Files changed (2)

File test/fixtures/config_localmysql_to_db_convert_nothing.yml

+mysql:
+ hostname: localhost
+ port: 3306
+ socket: /tmp/mysql.sock
+ username: mysql2psql
+ password: 
+ database: mysql2psql_test
+
+destination:
+ # if file is given, output goes to file, else postgres
+ file:
+ postgres:
+  hostname: localhost
+  port: 5432
+  username: mysql2psql
+  password: 
+  database: mysql2psql_test
+
+# if tables is given, only the listed tables will be converted.  leave empty to convert all tables.
+tables:
+- notexist
+
+# if exclude_tables is given, exclude the listed tables from the conversion.
+exclude_tables:
+- table5
+- table6
+
+# if supress_data is true, only the schema definition will be exported/migrated, and not the data
+supress_data: true
+
+# if supress_ddl is true, only the data will be exported/imported, and not the schema
+supress_ddl: true
+
+# if force_truncate is true, forces a table truncate before table loading
+force_truncate: true

File test/integration/postgres_db_writer_base_test.rb

 require 'test_helper'
 
-require 'mysql2psql'
+require 'mysql2psql/postgres_db_writer'
 
 class PostgresDbWriterBaseTest < Test::Unit::TestCase
   attr_accessor :options
   class << self
     def startup
       seed_test_database
+      @@options = get_test_config( 'config_localmysql_to_db_convert_nothing.yml' )
     end
     def shutdown
     end
   end
   def setup
-
+  end
+  def teardown
+  end
+  def options
+    @@options
   end
   
   def test_pg_connection
+    assert_nothing_raised do
+      reader = Mysql2psql::PostgresDbWriter.new(options)
+    end
   end
 
 end