spotlight-dor-resources 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7c9626527848a815f94b5e897c644439a4130b5
4
- data.tar.gz: a5bb46bce723dbdb76d9799a06954854a588f351
3
+ metadata.gz: a6454dc1dc2ecd62b6742f158f49c5d3c0463f13
4
+ data.tar.gz: fa13810076a206a0869e41cc8ab833f652833119
5
5
  SHA512:
6
- metadata.gz: e4f617b75c4659fb64a368eddf055168af6fcac6e9a8053aa3cd0d1c8d421ddf1e6083a3ce4f313dc453b246e9d59af9e1b90667325965d5566c40ce841a5e21
7
- data.tar.gz: 8aae9489098370a7ce5982813ded06b216ecc29d1b8f9d33909041a9f6dc82abcf2de25e975b6a07468acfc63b47764d7fc685df1de635095107e6289111796d
6
+ metadata.gz: e6f4acd16f57c69655e415a4e0d383e079593f9dc39ec867ebe264ebfac17b1b76b8084443a0e94fbe6e4f657512eed3bfcd0d9b560ee959d9c8c976381fd7a9
7
+ data.tar.gz: 5a0835148edb693100764d467fb9dcece618e5eeed95f30c35273649a5fb42c78ab42eb07d3b85606d4e6030776a4d8f5c1deaaf461c499cbf15a5c59364a468
@@ -11,15 +11,14 @@ Lint/UselessAccessModifier:
11
11
  Exclude:
12
12
  - 'lib/spotlight/dor/indexer.rb'
13
13
 
14
- # Offense count: 7
15
- # Configuration parameters: Max.
16
- RSpec/ExampleLength:
14
+ # Offense count: 1
15
+ RSpec/AnyInstance:
17
16
  Exclude:
18
- - 'spec/lib/spotlight/dor/indexer_spec.rb'
19
17
  - 'spec/models/spotlight/resources/dor_harvester_spec.rb'
20
18
 
21
- # Offense count: 2
22
- RSpec/VerifiedDoubles:
19
+ # Offense count: 6
20
+ # Configuration parameters: Max.
21
+ RSpec/ExampleLength:
23
22
  Exclude:
24
- - 'spec/integration/gdor_integration_spec.rb'
23
+ - 'spec/lib/spotlight/dor/indexer_spec.rb'
25
24
  - 'spec/models/spotlight/resources/dor_harvester_spec.rb'
@@ -12,9 +12,7 @@ module Spotlight::Resources
12
12
  end
13
13
 
14
14
  def resources
15
- @resources ||= druids.map do |d|
16
- Spotlight::Dor::Resources.indexer.resource d
17
- end
15
+ @resources ||= druids.map { |d| Spotlight::Dor::Resources.indexer.resource(d) }.select(&:exists?)
18
16
  end
19
17
 
20
18
  def druids
@@ -2,7 +2,7 @@ module Spotlight
2
2
  module Dor
3
3
  # :nodoc:
4
4
  module Resources
5
- VERSION = '2.0.0'.freeze
5
+ VERSION = '2.0.1'.freeze
6
6
  end
7
7
  end
8
8
  end
@@ -1,12 +1,9 @@
1
1
  describe 'gdor indexing integration test', :vcr do
2
- let :exhibit do
3
- double(solr_data: {}, blacklight_config: Blacklight::Configuration.new)
4
- end
2
+ let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
 
6
4
  subject do
7
- r = Spotlight::Resources::DorHarvester.new(druid_list: 'xf680rd3068')
5
+ r = Spotlight::Resources::DorHarvester.new(druid_list: 'xf680rd3068', exhibit: exhibit)
8
6
  allow(r).to receive(:to_global_id).and_return('x')
9
- allow(r).to receive(:exhibit).and_return(exhibit)
10
7
  r.document_builder.to_solr.first
11
8
  end
12
9
 
@@ -7,7 +7,7 @@ describe Spotlight::Resources::DorHarvester do
7
7
  double
8
8
  end
9
9
 
10
- subject { described_class.new druid_list: 'xf680rd3068' }
10
+ subject { described_class.new druid_list: 'xf680rd3068', exhibit: exhibit }
11
11
  let(:resource) { subject.resources.first }
12
12
 
13
13
  before do
@@ -61,13 +61,25 @@ describe Spotlight::Resources::DorHarvester do
61
61
  it 'has the correct indexer' do
62
62
  expect(resource.indexer).to eq Spotlight::Dor::Resources.indexer.harvestdor
63
63
  end
64
+
65
+ context 'with an unpublished druid' do
66
+ let(:missing_resource) { instance_double(Harvestdor::Indexer::Resource, exists?: false) }
67
+
68
+ before do
69
+ allow(Spotlight::Dor::Resources.indexer).to receive(:resource).with('xf680rd3068').and_return(missing_resource)
70
+ end
71
+
72
+ it 'excludes missing resources' do
73
+ expect(subject.resources).to be_empty
74
+ end
75
+ end
64
76
  end
65
77
 
66
78
  describe '#reindex' do
67
79
  before do
68
80
  allow(Spotlight::Dor::Resources.indexer).to receive(:solr_document).and_return(upstream: true)
69
81
  allow(resource).to receive(:collection?).and_return(false)
70
- allow(exhibit).to receive(:solr_data).and_return({})
82
+ allow_any_instance_of(SolrDocument).to receive(:to_solr).and_return({})
71
83
  end
72
84
 
73
85
  it 'adds a document to solr' do
@@ -24,9 +24,9 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency 'solrizer'
25
25
  spec.add_dependency 'gdor-indexer', '>=0.5.0' # for new pub date methods
26
26
  # newer versions of harvestdor-indexer have performance improvements for collections
27
- spec.add_dependency 'harvestdor-indexer', '~> 2.3', '>= 2.3.2'
27
+ spec.add_dependency 'harvestdor-indexer', '~> 2.4'
28
28
  spec.add_dependency 'rails'
29
- spec.add_dependency 'blacklight-spotlight', '~> 0.19'
29
+ spec.add_dependency 'blacklight-spotlight', '~> 0.20'
30
30
  spec.add_dependency 'parallel'
31
31
  spec.add_dependency 'stanford-mods', '~> 2.1'
32
32
  spec.add_development_dependency 'bundler', '~> 1.5'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spotlight-dor-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-25 00:00:00.000000000 Z
11
+ date: 2016-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -58,20 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.3'
62
- - - ">="
63
- - !ruby/object:Gem::Version
64
- version: 2.3.2
61
+ version: '2.4'
65
62
  type: :runtime
66
63
  prerelease: false
67
64
  version_requirements: !ruby/object:Gem::Requirement
68
65
  requirements:
69
66
  - - "~>"
70
67
  - !ruby/object:Gem::Version
71
- version: '2.3'
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- version: 2.3.2
68
+ version: '2.4'
75
69
  - !ruby/object:Gem::Dependency
76
70
  name: rails
77
71
  requirement: !ruby/object:Gem::Requirement
@@ -92,14 +86,14 @@ dependencies:
92
86
  requirements:
93
87
  - - "~>"
94
88
  - !ruby/object:Gem::Version
95
- version: '0.19'
89
+ version: '0.20'
96
90
  type: :runtime
97
91
  prerelease: false
98
92
  version_requirements: !ruby/object:Gem::Requirement
99
93
  requirements:
100
94
  - - "~>"
101
95
  - !ruby/object:Gem::Version
102
- version: '0.19'
96
+ version: '0.20'
103
97
  - !ruby/object:Gem::Dependency
104
98
  name: parallel
105
99
  requirement: !ruby/object:Gem::Requirement