require 'spec_helper' require 'flydata-core/table_def' module FlydataCore module TableDef describe 'generate redshift table ddl from mysqldump' do # file full path which exists in same directory. def full_path(file_name) File.join(File.dirname(__FILE__), file_name) end def file_io(file_name) File.new(full_path(file_name)) end let(:dump_file_name) { raise "file_name must be override on context." } let(:dump_file_io) { file_io(dump_file_name) } subject { RedshiftTableDef.from_flydata_tabledef( MysqlTableDef.create(dump_file_io).to_flydata_tabledef) } context 'with mysqldump_test_table_all' do let(:dump_file_name) { 'mysqldump_test_table_all.dump' } it 'should return ddl' do expect(subject).to eq( <