Sha256: bc893c3c74b39a69c074053ac640852853b9e8b9f69eeb941d55e41366813585

Contents?: true

Size: 1.73 KB

Versions: 7

Compression:

Stored size: 1.73 KB

Contents

require 'spec_helper'

module Ddr::IngestTools::ManifestArkMinter

  RSpec.describe Minter do

    describe '#initialize' do
      describe 'Ezid::Identifier defaults' do
        before { described_class.new }
        let(:ark_defaults) { { export: described_class::DEFAULT_EXPORT,
                               profile: described_class::DEFAULT_PROFILE,
                               status: described_class::DEFAULT_STATUS } }
        it 'configures Ezid::Identifer defaults' do
          expect(Ezid::Identifier.defaults).to match(ark_defaults)
        end
      end
      describe 'Ezid::Client configuration' do
        let(:configuration) { Configuration.new }
        before do
          configuration.ezid_default_shoulder = 'ark:/99999/fk4'
          configuration.ezid_password = 'apitest'
          configuration.ezid_user = 'apitest'
          allow(Ddr::IngestTools::ManifestArkMinter).to receive(:configuration) { configuration }
          described_class.new
        end
        it 'configures the Ezid::Client' do
          expect(Ezid::Client.config.default_shoulder).to eq('ark:/99999/fk4')
          expect(Ezid::Client.config.password).to eq('apitest')
          expect(Ezid::Client.config.user).to eq('apitest')
        end
      end
    end

    describe '#mint' do
      let(:configuration) { Configuration.new }
      before do
        configuration.ezid_default_shoulder = 'ark:/99999/fk4'
        configuration.ezid_password = 'apitest'
        configuration.ezid_user = 'apitest'
        allow(Ddr::IngestTools::ManifestArkMinter).to receive(:configuration) { configuration }
      end
      it 'calls Ezid::Identifier to mint an ark' do
        expect(Ezid::Identifier).to receive(:mint)
        subject.mint
      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/minter_spec.rb
ddr-ingesttools-0.6.0 spec/manifest_ark_minter/minter_spec.rb
ddr-ingesttools-0.5.0 spec/manifest_ark_minter/minter_spec.rb
ddr-ingesttools-0.5.0.rc3 spec/manifest_ark_minter/minter_spec.rb
ddr-ingesttools-0.5.0.rc2 spec/manifest_ark_minter/minter_spec.rb
ddr-ingesttools-0.5.0.rc1 spec/manifest_ark_minter/minter_spec.rb
ddr-ingesttools-0.4.0 spec/manifest_ark_minter/minter_spec.rb