Sha256: 57d3778521e9f6abf922eace0cc0e1c1dfa64cc0615b5b403081a9ec15035e17

Contents?: true

Size: 1.32 KB

Versions: 2

Compression:

Stored size: 1.32 KB

Contents

require 'spec_helper'
require 'tempfile'

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

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

    let(:files) { File.join('spec', 'fixtures', 'ddr_rdr_migrator', 'source', 'changeme-664',
                            'changeme-664-export-file') }
    let(:metadata_file) { File.join('spec', 'fixtures', 'ddr_rdr_migrator', 'source', 'changeme-664', 'changeme-664.csv') }
    let(:outdir) { Dir.mktmpdir }
    let(:checksum_file) { File.join(outdir, 'checksums.txt') }
    let(:expected_checksum_file) { File.join('spec', 'fixtures', 'ddr_rdr_migrator', 'target', 'changeme-664',
                                             'checksums.txt') }
    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))
      expect(File.read(checksum_file)).to eq(File.read(expected_checksum_file))
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ddr-ingesttools-0.6.1 spec/ddr_rdr_migrator/migrator_spec.rb
ddr-ingesttools-0.6.0 spec/ddr_rdr_migrator/migrator_spec.rb