Sha256: 4725c1fc52f77f3d3565e64d0da870d78b554e746eeb4da91223bb80815c2936

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

require 'spec_helper'
module Exlibris
  module Aleph
    module API
      module Client
        describe Record, vcr: {cassette_name: 'record'} do
          let(:id) { 'NYU01000980206' }
          let(:query) { {view: 'full'} }
          subject(:record) { Record.new(id, query) }
          it { should be_a Record }
          describe '#id' do
            subject { record.id }
            it { should eq id }
          end
          describe '#reply_code' do
            subject { record.reply_code }
            it { should eq '0000' }
          end
          describe '#reply_text' do
            subject { record.reply_text }
            it { should eq 'ok' }
          end
          describe '#error?' do
            subject { record.error? }
            it { should be_false }
          end
          describe '#to_h' do
            subject { record.to_h }
            it { should be_a Hash }
          end
          describe '#to_xml' do
            subject { record.to_xml }
            it { should be_a String }
          end
          context 'when initialized without a "query" argument' do
            subject { Record.new(id) }
            it { should be_a Record }
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
exlibris-aleph-2.0.4 spec/exlibris/aleph/api/client/record_spec.rb
exlibris-aleph-2.0.3 spec/exlibris/aleph/api/client/record_spec.rb
exlibris-aleph-2.0.0 spec/exlibris/aleph/api/client/record_spec.rb