Sha256: 2a943c3552d6122bb727b1439348483d84efe453b4068b5f41052285a19c71ae

Contents?: true

Size: 950 Bytes

Versions: 4

Compression:

Stored size: 950 Bytes

Contents

require 'spec_helper'
require 'tempfile'

module Ddr::IngestTools::DdrRdrMigrator
  RSpec.describe Migrator do

    subject { described_class.new(files: files, metadata: metadata, outfile: outfile) }

    let(:files) { File.join('spec', 'fixtures', 'ddr_rdr_migrator', 'source', 'changeme-664',
                            'changeme-664-export-file') }
    let(:metadata) { File.join('spec', 'fixtures', 'ddr_rdr_migrator', 'source', 'changeme-664', 'changeme-664.csv') }
    let(:outdir) { Dir.mktmpdir }
    let(:outfile) { File.join(outdir, 'manifest.csv') }
    let(:expected_outfile) { File.join('spec', 'fixtures', 'ddr_rdr_migrator', 'target', 'changeme-664',
                                       'manifest.csv') }

    after { FileUtils.remove_dir outdir }

    it 'produces the expected manifest file' do
      subject.call
      expect(CSV.read(outfile, headers: true)).to eq(CSV.read(expected_outfile, headers: true))
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ddr-ingesttools-0.5.0 spec/ddr_rdr_migrator/migrator_spec.rb
ddr-ingesttools-0.5.0.rc3 spec/ddr_rdr_migrator/migrator_spec.rb
ddr-ingesttools-0.5.0.rc2 spec/ddr_rdr_migrator/migrator_spec.rb
ddr-ingesttools-0.5.0.rc1 spec/ddr_rdr_migrator/migrator_spec.rb