Sha256: 945f3ed5178310ceca92a44cb66c62fad964ed8e0a0ba63c7662d212d9bdfe32

Contents?: true

Size: 1.46 KB

Versions: 7

Compression:

Stored size: 1.46 KB

Contents

require 'spec_helper'

module Ddr::IngestTools::ManifestArkMinter

  RSpec.describe ManifestParser do

    subject { described_class.new(manifest_file) }

    describe '#as_csv_table' do
      let(:manifest_file) { File.join('spec', 'fixtures', 'rdr_importer', 'manifests', 'manifest_with_some_arks.csv') }
      specify { expect(subject.as_csv_table).to be_a CSV::Table }
    end

    describe '#headers' do
      let(:manifest_file) { File.join('spec', 'fixtures', 'rdr_importer', 'manifests', 'manifest_with_some_arks.csv') }
      let(:expected_headers) { %w(ark visibility title contributor resource_type license file) }
      it 'parses out the list of headers' do
        expect(subject.headers).to include(*expected_headers)
      end
    end

    describe '#arks_missing?' do
      describe 'no arks assigned' do
        let(:manifest_file) { File.join('spec', 'fixtures', 'rdr_importer', 'manifests', 'manifest_with_no_arks.csv') }
        specify { expect(subject.arks_missing?).to be true }
      end
      describe 'some arks assigned' do
        let(:manifest_file) { File.join('spec', 'fixtures', 'rdr_importer', 'manifests', 'manifest_with_some_arks.csv') }
        specify { expect(subject.arks_missing?).to be true }
      end
      describe 'all arks assigned' do
        let(:manifest_file) { File.join('spec', 'fixtures', 'rdr_importer', 'manifests', 'manifest_with_all_arks.csv') }
        specify { expect(subject.arks_missing?).to be false }
      end
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ddr-ingesttools-0.6.1 spec/manifest_ark_minter/manifest_parser_spec.rb
ddr-ingesttools-0.6.0 spec/manifest_ark_minter/manifest_parser_spec.rb
ddr-ingesttools-0.5.0 spec/manifest_ark_minter/manifest_parser_spec.rb
ddr-ingesttools-0.5.0.rc3 spec/manifest_ark_minter/manifest_parser_spec.rb
ddr-ingesttools-0.5.0.rc2 spec/manifest_ark_minter/manifest_parser_spec.rb
ddr-ingesttools-0.5.0.rc1 spec/manifest_ark_minter/manifest_parser_spec.rb
ddr-ingesttools-0.4.0 spec/manifest_ark_minter/manifest_parser_spec.rb