require 'spec_helper' require 'flydata-core/query_job/redshift' module FlydataCore::QueryJob describe Redshift do describe '.target_table_names' do subject { described_class.target_table_names(flydata_table_names) } context 'with a single table name' do let(:flydata_table_names) { "my_table" } it { is_expected.to eq [ flydata_table_names ] } end context 'with multiples table names' do let(:flydata_table_names) { %w(my_table1 my_table2) } it { is_expected.to eq flydata_table_names } end context 'with a mixed case table name' do let(:flydata_table_names) { "MyTable" } it { is_expected.to eq [ flydata_table_names.downcase, flydata_table_names ] } end context 'with table names including mixed case one' do let(:flydata_table_names) { %w(MyTable my_table2) } it { is_expected.to eq %w(mytable MyTable my_table2) } end end end end