Sha256: 6d6f0d1767b7b2cb5d3d904c22b66329158e84762f629dda35333bc62ac1c971

Contents?: true

Size: 809 Bytes

Versions: 36

Compression:

Stored size: 809 Bytes

Contents

# frozen_string_literal: true

RSpec.shared_examples 'a Hyrax::Identifier::Builder' do
  subject(:builder) { described_class.new }

  describe '#build' do
    it 'returns an identifier string' do
      expect(builder.build(hint: 'moomin'))
        .to respond_to :to_str
    end
  end
end

RSpec.shared_examples 'a Hyrax::Identifier::Registrar' do
  subject(:registrar) { described_class.new(builder: builder) }
  let(:builder)       { instance_double(Hyrax::Identifier::Builder, build: 'moomin') }
  let(:object)        { instance_double(GenericWork, id: 'moomin_id') }

  it { is_expected.to have_attributes(builder: builder) }

  describe '#register!' do
    it 'creates an identifier record' do
      expect(registrar.register!(object: object).identifier)
        .to respond_to :to_str
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-5.0.4 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-5.0.3 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-5.0.2 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-5.0.1 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-5.0.0 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-5.0.0.rc3 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-5.0.0.rc2 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-5.0.0.rc1 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-3.6.0 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-4.0.0 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-4.0.0.rc3 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-4.0.0.rc2 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-4.0.0.rc1 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-3.5.0 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-4.0.0.beta2 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-3.4.2 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-4.0.0.beta1 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-3.4.1 lib/hyrax/specs/shared_specs/identifiers.rb
hyrax-3.4.0 lib/hyrax/specs/shared_specs/identifiers.rb