Sha256: 085d5547a86785cb1a280aa8a6d5f7d3ff36e139e531b183976993416227da70

Contents?: true

Size: 1.21 KB

Versions: 16

Compression:

Stored size: 1.21 KB

Contents

# encoding: utf-8
require_relative 'spec_helper'

require 'libis/tools/config_file'
require 'libis/services/rosetta/oai_pmh'

describe 'Rosetta OAI-PMH Service' do

  let(:credentials) { Libis::Tools::ConfigFile.new File.join(File.dirname(__FILE__), 'credentials-test.yml'), debug: true }

  subject(:oai_handler) do
    # noinspection RubyResolve
    Libis::Services::Rosetta::OaiPmh.new credentials.rosetta_url
  end

  let(:expected_sets) {
    [
        {name:'TESTINS-collections', spec: 'TESTINS-collections'}
    ]
  }

  let(:expected_collections) {
    [
        'Kerk & Leven',
        'Kerk en leven. Bisdom Antwerpen (0991).',
    ]
  }

  let(:expected_records) {
    [
        {
            id: 'oai:d4I1-pubam:IE405650',
        }
    ]
  }

  it 'should get set list' do
    sets = oai_handler.sets
    expect(sets[:entries]).to deep_include(expected_sets)
  end

  it 'should get list of collections' do
    status = {}
    collections = oai_handler.collections('TESTINS', status)
    expect(collections).to deep_include(expected_collections)
  end

  it 'should get list of records' do
    status = {}
    records = oai_handler.records('test_data', status)
    expect(records).to deep_include(expected_records)
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
libis-services-1.0.10 spec/rosetta_oai_spec.rb
libis-services-1.0.7 spec/rosetta_oai_spec.rb
libis-services-1.0.6 spec/rosetta_oai_spec.rb
libis-services-1.0.5 spec/rosetta_oai_spec.rb
libis-services-1.0.2 spec/rosetta_oai_spec.rb
libis-services-1.0.1 spec/rosetta_oai_spec.rb
libis-services-1.0.0 spec/rosetta_oai_spec.rb
libis-services-0.2.1 spec/rosetta_oai_spec.rb
libis-services-0.2.0 spec/rosetta_oai_spec.rb
libis-services-0.1.18 spec/rosetta_oai_spec.rb
libis-services-0.1.17 spec/rosetta_oai_spec.rb
libis-services-0.1.16 spec/rosetta_oai_spec.rb
libis-services-0.1.15 spec/rosetta_oai_spec.rb
libis-services-0.1.14 spec/rosetta_oai_spec.rb
libis-services-0.1.13 spec/rosetta_oai_spec.rb
libis-services-0.1.12 spec/rosetta_oai_spec.rb