require 'spec_helper' require 'flydata/table_def' module Flydata module TableDef describe RedshiftTableDef do describe '.from_flydata_tabledef' do let(:flydata_tabledef) { { table_name: "test_table", columns: [ { column: "id", type: "int4(11)", not_null: true, primary_key: true }, { column: "age", type: "int4(11) unsigned" }, { column: "value", type: "text" }, ], default_charset: "utf8;"} } let(:option) { { flydata_ctl_table: false } } subject { described_class.from_flydata_tabledef(flydata_tabledef, option) } context 'with simple flydatadef' do it 'should return ddl' do expect(subject).to eq( <