Sha256: b114cb3e0e9589a135d164aa692eb391190b12482ce7f77ae035883cc199c05f

Contents?: true

Size: 894 Bytes

Versions: 47

Compression:

Stored size: 894 Bytes

Contents

# frozen_string_literal: true
RSpec.shared_examples 'a Valkyrie::MetadataAdapter' do |passed_adapter|
  before do
    raise 'adapter must be set with `let(:adapter)`' unless
      defined? adapter
  end
  subject { passed_adapter || adapter }
  it { is_expected.to respond_to(:persister).with(0).arguments }
  it { is_expected.to respond_to(:query_service).with(0).arguments }
  it { is_expected.to respond_to(:id).with(0).arguments }
  it "caches query_service so it can register custom queries" do
    expect(subject.query_service.custom_queries.query_handlers.object_id).to eq subject.query_service.custom_queries.query_handlers.object_id
  end

  describe "#id" do
    it "is a valid string representation of an MD5 hash" do
      expect(adapter.id).to be_a Valkyrie::ID
      expect(adapter.id.to_s.length).to eq 32
      expect(adapter.id.to_s).to match(/^[a-f,0-9]+$/)
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
valkyrie-3.4.0 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.3.0 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.1.5 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.1.4 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.1.3 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.1.2 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.1.1 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.1.0 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.0.3 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.0.2 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.0.1 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.0.0 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.0.0.pre.rc.1 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.0.0.pre.beta.3 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.0.0.pre.beta.2 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-3.0.0.pre.beta.1 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-2.2.0 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-2.1.2 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-2.1.1 lib/valkyrie/specs/shared_specs/metadata_adapter.rb
valkyrie-2.1.0 lib/valkyrie/specs/shared_specs/metadata_adapter.rb