Sha256: 066dcf0b9514710d9e68e20b88f23fec349001724346adeedb858a84442eb1b3

Contents?: true

Size: 936 Bytes

Versions: 24

Compression:

Stored size: 936 Bytes

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'

describe Krikri::Harvesters::ApiHarvester do
  it_behaves_like 'a harvester'

  let(:args) { { uri: 'http://example.org/endpoint' } }
  subject { described_class.new(args) }

  shared_context 'with responses' do
    let(:query_opts) { { :q => 'tags_ssim:dpla' } }
    let(:response_string) do
      <<EOM
{ "response": {
    "numFound": 467354,
    "start": 0,
    "docs": []
  }
}
EOM
    end

    before do
      allow(RestClient).to recieve(:get).with(args[:uri], query_opts)
                            .and_return(response_string)
    end
  end

  describe '#new' do
    it 'accepts api parameters' do
      described_class.new()
      require 'pry'
      binding.pry
    end
  end

  describe '.expected_opts' do
    it 'returns a hash with key and options' do
    end
  end

  describe '#count' do
    it 'returns a count' do
      expect(subject.count).to eq 100
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
krikri-0.13.2 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.13.1 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.13.0 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.12.4 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.11.2 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.11.1 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.11.0 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.10.1 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.8.9 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.8.8 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.8.7 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.8.6 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.8.5 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.8.4 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.8.2 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.8.0 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.7.3 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.7.2 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.7.1 spec/lib/krikri/harvesters/api_harvester_spec.rb~
krikri-0.6.0 spec/lib/krikri/harvesters/api_harvester_spec.rb~