Sha256: d282c0c88fea33536d3de907d1e842daf5fb519f17001fababeb3f392ebc55be

Contents?: true

Size: 792 Bytes

Versions: 14

Compression:

Stored size: 792 Bytes

Contents

module Ezid
  RSpec.describe "proxy identifier", deprecated: true do
    require 'ezid/proxy_identifier'
    describe ProxyIdentifier do
      describe "initialization" do
        it "should not load the real identifier" do
          expect(Identifier).not_to receive(:find)
          described_class.new("ark:/99999/fk4fn19h88")
        end
      end

      describe "lazy loading" do
        subject { described_class.new(id) }

        let(:id) { "ark:/99999/fk4fn19h88" }
        let(:real) { double(id: id, target: "http://ezid.cdlib.org/id/#{id}") }

        it "should load the real identifier when calling a missing method" do
          expect(Identifier).to receive(:find).with(id) { real }
          expect(subject.target).to eq(real.target)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ezid-client-1.10.0 spec/unit/proxy_identifier_spec.rb
ezid-client-1.9.4 spec/unit/proxy_identifier_spec.rb
ezid-client-1.9.3 spec/unit/proxy_identifier_spec.rb
ezid-client-1.9.2 spec/unit/proxy_identifier_spec.rb
ezid-client-1.9.1 spec/unit/proxy_identifier_spec.rb
ezid-client-1.9.0 spec/unit/proxy_identifier_spec.rb
ezid-client-1.9.0.rc1 spec/unit/proxy_identifier_spec.rb
ezid-client-1.8.0 spec/unit/proxy_identifier_spec.rb
ezid-client-1.7.1 spec/unit/proxy_identifier_spec.rb
ezid-client-1.7.0 spec/unit/proxy_identifier_spec.rb
ezid-client-1.6.0 spec/unit/proxy_identifier_spec.rb
ezid-client-1.5.0 spec/unit/proxy_identifier_spec.rb
ezid-client-1.4.3 spec/unit/proxy_identifier_spec.rb
ezid-client-1.4.2 spec/unit/proxy_identifier_spec.rb