Sha256: b1c533e8ade7b2ee9bf77ecb2b66631bd3b4aeb96c264dff95f9c23361a73dca

Contents?: true

Size: 417 Bytes

Versions: 3

Compression:

Stored size: 417 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'postgres-copy/with_temp_table'

describe '.generate' do
  subject(:generate) {
    PostgresCopy::WithTempTable.generate do |t|
      t.string :data
    end
  }

  it {
    generate.copy_from 'spec/fixtures/comma_with_header.csv'
    data = generate.all.first
    expect(data.id).to eq(1)
    expect(data.data).to eq('test data 1')
  }
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
postgres-copy-1.7.2 spec/postgres-copy/with_temp_table_spec.rb
postgres-copy-1.7.1 spec/postgres-copy/with_temp_table_spec.rb
postgres-copy-1.7.0 spec/postgres-copy/with_temp_table_spec.rb