Sha256: 6ece2fe128f5542a77a8a207bdcb96d9cb6e14a6a0adbaf4e3cd808dfd22ceea
Contents?: true
Size: 939 Bytes
Versions: 1
Compression:
Stored size: 939 Bytes
Contents
require 'active_fedora/noid/service' require 'active_fedora/noid/synchronized_minter' describe ActiveFedora::Noid::Service do describe 'public API' do it { is_expected.to respond_to(:valid?) } it { is_expected.to respond_to(:mint) } end it 'has a default minter' do expect(subject.minter).to be_instance_of ActiveFedora::Noid::SynchronizedMinter end context 'with a custom minter' do let(:minter) { double('minter') } let(:identifier) { 'abc123' } let(:new_service) { ActiveFedora::Noid::Service.new(minter) } it 'allows injecting a custom minter' do expect(new_service.minter).to eq minter end it 'delegates validity checking to the minter' do expect(minter).to receive(:valid?).with(identifier).once new_service.valid? identifier end it 'delegates minting to the minter' do expect(minter).to receive(:mint).once new_service.mint end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
active_fedora-noid-0.2.0 | spec/unit/service_spec.rb |