active-fedora 3.1.0.rc3 → 3.1.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +4 -4
- data/Rakefile +2 -0
- data/active-fedora.gemspec +1 -1
- data/lib/active_fedora/base.rb +29 -10
- data/lib/active_fedora/datastream.rb +22 -28
- data/lib/active_fedora/datastream_hash.rb +5 -0
- data/lib/active_fedora/digital_object.rb +19 -0
- data/lib/active_fedora/model.rb +2 -2
- data/lib/active_fedora/rels_ext_datastream.rb +0 -15
- data/lib/active_fedora/semantic_node.rb +3 -3
- data/lib/active_fedora/version.rb +1 -1
- data/lib/tasks/active_fedora_dev.rake +1 -0
- data/spec/integration/base_spec.rb +2 -2
- data/spec/spec_helper.rb +3 -0
- data/spec/support/mock_fedora.rb +37 -0
- data/spec/unit/base_datastream_management_spec.rb +2 -1
- data/spec/unit/base_extra_spec.rb +5 -2
- data/spec/unit/base_named_datastream_spec.rb +1 -1
- data/spec/unit/base_spec.rb +90 -87
- data/spec/unit/content_model_spec.rb +3 -1
- data/spec/unit/datastream_spec.rb +7 -24
- data/spec/unit/nokogiri_datastream_spec.rb +1 -1
- data/spec/unit/qualified_dublin_core_datastream_spec.rb +4 -0
- data/spec/unit/rels_ext_datastream_spec.rb +0 -27
- data/spec/unit/solr_config_options_spec.rb +2 -1
- metadata +81 -79
@@ -170,7 +170,7 @@ describe ActiveFedora::NokogiriDatastream do
|
|
170
170
|
@test_ds.should respond_to(:save)
|
171
171
|
end
|
172
172
|
it "should persist the product of .to_xml in fedora" do
|
173
|
-
@test_ds.expects(:new?).returns(true)
|
173
|
+
@test_ds.expects(:new?).returns(true).twice
|
174
174
|
@mock_repo.expects(:add_datastream).with(:pid => nil, :dsid => 'descMetadata', :checksumType => 'DISABLED', :versionable => true, :content => 'fake xml', :controlGroup => 'M', :dsState => 'A')
|
175
175
|
@test_ds.expects(:to_xml).returns("fake xml")
|
176
176
|
@test_ds.serialize!
|
@@ -14,6 +14,8 @@ describe ActiveFedora::QualifiedDublinCoreDatastream do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
before(:each) do
|
17
|
+
stub_get("_nextid_")
|
18
|
+
Rubydora::Repository.any_instance.stubs(:client).returns(@mock_client)
|
17
19
|
ActiveFedora::RubydoraConnection.instance.stubs(:nextid).returns("_nextid_")
|
18
20
|
@test_ds = ActiveFedora::QualifiedDublinCoreDatastream.new(nil, nil)
|
19
21
|
@test_ds.stubs(:content).returns('')
|
@@ -21,6 +23,8 @@ describe ActiveFedora::QualifiedDublinCoreDatastream do
|
|
21
23
|
end
|
22
24
|
it "from_xml should parse everything correctly" do
|
23
25
|
#originally just tested that lcsh encoding and stuff worked, but the other stuff is worth testing
|
26
|
+
stub_get("meh:leh")
|
27
|
+
stub_get_content("meh:leh", ['dublin_core'])
|
24
28
|
ActiveFedora::RubydoraConnection.instance.expects(:nextid).returns("meh:leh")
|
25
29
|
tmpl = OralHistorySampleModel.new.datastreams['dublin_core']
|
26
30
|
|
@@ -116,33 +116,6 @@ describe ActiveFedora::RelsExtDatastream do
|
|
116
116
|
end
|
117
117
|
|
118
118
|
|
119
|
-
describe ".to_solr" do
|
120
|
-
|
121
|
-
it "should provide .to_solr and return a SolrDocument" do
|
122
|
-
graph = RDF::Graph.new
|
123
|
-
subject = RDF::URI.new "info:fedora/test:sample_pid"
|
124
|
-
graph.insert RDF::Statement.new(subject, ActiveFedora::Base.new.find_graph_predicate(:is_member_of), RDF::URI.new('demo:10'))
|
125
|
-
@test_ds.should respond_to(:to_solr)
|
126
|
-
@test_ds.expects(:model).returns(stub("model", :relationships=>graph, :relationships_are_dirty= => true))
|
127
|
-
@test_ds.to_solr.should be_kind_of(Hash)
|
128
|
-
end
|
129
|
-
|
130
|
-
it "should serialize the relationships into a Hash" do
|
131
|
-
graph = RDF::Graph.new
|
132
|
-
subject = RDF::URI.new "info:fedora/test:sample_pid"
|
133
|
-
graph.insert RDF::Statement.new(subject, ActiveFedora::Base.new.find_graph_predicate(:is_member_of), RDF::URI.new('info:fedora/demo:10'))
|
134
|
-
graph.insert RDF::Statement.new(subject, ActiveFedora::Base.new.find_graph_predicate(:is_part_of), RDF::URI.new('info:fedora/demo:11'))
|
135
|
-
graph.insert RDF::Statement.new(subject, ActiveFedora::Base.new.find_graph_predicate(:has_part), RDF::URI.new('info:fedora/demo:12'))
|
136
|
-
graph.insert RDF::Statement.new(subject, ActiveFedora::Base.new.find_graph_predicate(:conforms_to), "AnInterface")
|
137
|
-
|
138
|
-
@test_ds.expects(:model).returns(stub("model", :relationships=>graph, :relationships_are_dirty= => true))
|
139
|
-
solr_doc = @test_ds.to_solr
|
140
|
-
solr_doc["is_member_of_s"].should == ["info:fedora/demo:10"]
|
141
|
-
solr_doc["is_part_of_s"].should == ["info:fedora/demo:11"]
|
142
|
-
solr_doc["has_part_s"].should == ["info:fedora/demo:12"]
|
143
|
-
solr_doc["conforms_to_s"].should == ["AnInterface"]
|
144
|
-
end
|
145
|
-
end
|
146
119
|
|
147
120
|
it "should treat :self and self.pid as equivalent subjects"
|
148
121
|
|
@@ -80,8 +80,9 @@ describe ActiveFedora do
|
|
80
80
|
|
81
81
|
it "should prevent Base.save from calling update_index if false" do
|
82
82
|
dirty_ds = ActiveFedora::MetadataDatastream.new(@test_object.inner_object, 'ds1')
|
83
|
+
@test_object.datastreams['ds1'] = dirty_ds
|
83
84
|
repo = @test_object.inner_object.repository
|
84
|
-
repo.expects(:add_datastream)
|
85
|
+
repo.expects(:add_datastream)
|
85
86
|
repo.expects(:ingest)
|
86
87
|
@test_object.stubs(:datastreams).returns({:ds1 => dirty_ds})
|
87
88
|
@test_object.expects(:update_index).never
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-fedora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15424109
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
9
|
- 0
|
10
10
|
- rc
|
11
|
-
-
|
12
|
-
version: 3.1.0.
|
11
|
+
- 4
|
12
|
+
version: 3.1.0.rc4
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Matt Zumwalt
|
@@ -18,13 +18,14 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2011-
|
21
|
+
date: 2011-11-02 00:00:00 -05:00
|
22
22
|
default_executable:
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
25
|
name: solr-ruby
|
26
|
+
type: :runtime
|
26
27
|
prerelease: false
|
27
|
-
|
28
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
28
29
|
none: false
|
29
30
|
requirements:
|
30
31
|
- - ">="
|
@@ -35,12 +36,12 @@ dependencies:
|
|
35
36
|
- 0
|
36
37
|
- 6
|
37
38
|
version: 0.0.6
|
38
|
-
|
39
|
-
version_requirements: *id001
|
39
|
+
requirement: *id001
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: xml-simple
|
42
|
+
type: :runtime
|
42
43
|
prerelease: false
|
43
|
-
|
44
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
44
45
|
none: false
|
45
46
|
requirements:
|
46
47
|
- - ">="
|
@@ -51,12 +52,12 @@ dependencies:
|
|
51
52
|
- 0
|
52
53
|
- 12
|
53
54
|
version: 1.0.12
|
54
|
-
|
55
|
-
version_requirements: *id002
|
55
|
+
requirement: *id002
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: mime-types
|
58
|
+
type: :runtime
|
58
59
|
prerelease: false
|
59
|
-
|
60
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
60
61
|
none: false
|
61
62
|
requirements:
|
62
63
|
- - ">="
|
@@ -66,12 +67,12 @@ dependencies:
|
|
66
67
|
- 1
|
67
68
|
- 16
|
68
69
|
version: "1.16"
|
69
|
-
|
70
|
-
version_requirements: *id003
|
70
|
+
requirement: *id003
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: multipart-post
|
73
|
+
type: :runtime
|
73
74
|
prerelease: false
|
74
|
-
|
75
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
75
76
|
none: false
|
76
77
|
requirements:
|
77
78
|
- - "="
|
@@ -82,12 +83,12 @@ dependencies:
|
|
82
83
|
- 1
|
83
84
|
- 2
|
84
85
|
version: 1.1.2
|
85
|
-
|
86
|
-
version_requirements: *id004
|
86
|
+
requirement: *id004
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
88
|
name: nokogiri
|
89
|
+
type: :runtime
|
89
90
|
prerelease: false
|
90
|
-
|
91
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
91
92
|
none: false
|
92
93
|
requirements:
|
93
94
|
- - ">="
|
@@ -96,12 +97,12 @@ dependencies:
|
|
96
97
|
segments:
|
97
98
|
- 0
|
98
99
|
version: "0"
|
99
|
-
|
100
|
-
version_requirements: *id005
|
100
|
+
requirement: *id005
|
101
101
|
- !ruby/object:Gem::Dependency
|
102
102
|
name: om
|
103
|
+
type: :runtime
|
103
104
|
prerelease: false
|
104
|
-
|
105
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
105
106
|
none: false
|
106
107
|
requirements:
|
107
108
|
- - ">="
|
@@ -112,12 +113,12 @@ dependencies:
|
|
112
113
|
- 4
|
113
114
|
- 3
|
114
115
|
version: 1.4.3
|
115
|
-
|
116
|
-
version_requirements: *id006
|
116
|
+
requirement: *id006
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: solrizer
|
119
|
+
type: :runtime
|
119
120
|
prerelease: false
|
120
|
-
|
121
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
121
122
|
none: false
|
122
123
|
requirements:
|
123
124
|
- - ">"
|
@@ -128,12 +129,12 @@ dependencies:
|
|
128
129
|
- 0
|
129
130
|
- 0
|
130
131
|
version: 1.0.0
|
131
|
-
|
132
|
-
version_requirements: *id007
|
132
|
+
requirement: *id007
|
133
133
|
- !ruby/object:Gem::Dependency
|
134
134
|
name: activeresource
|
135
|
+
type: :runtime
|
135
136
|
prerelease: false
|
136
|
-
|
137
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
137
138
|
none: false
|
138
139
|
requirements:
|
139
140
|
- - ~>
|
@@ -144,12 +145,12 @@ dependencies:
|
|
144
145
|
- 0
|
145
146
|
- 0
|
146
147
|
version: 3.0.0
|
147
|
-
|
148
|
-
version_requirements: *id008
|
148
|
+
requirement: *id008
|
149
149
|
- !ruby/object:Gem::Dependency
|
150
150
|
name: activesupport
|
151
|
+
type: :runtime
|
151
152
|
prerelease: false
|
152
|
-
|
153
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
153
154
|
none: false
|
154
155
|
requirements:
|
155
156
|
- - ~>
|
@@ -160,12 +161,12 @@ dependencies:
|
|
160
161
|
- 0
|
161
162
|
- 0
|
162
163
|
version: 3.0.0
|
163
|
-
|
164
|
-
version_requirements: *id009
|
164
|
+
requirement: *id009
|
165
165
|
- !ruby/object:Gem::Dependency
|
166
166
|
name: mediashelf-loggable
|
167
|
+
type: :runtime
|
167
168
|
prerelease: false
|
168
|
-
|
169
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
169
170
|
none: false
|
170
171
|
requirements:
|
171
172
|
- - ">="
|
@@ -174,12 +175,12 @@ dependencies:
|
|
174
175
|
segments:
|
175
176
|
- 0
|
176
177
|
version: "0"
|
177
|
-
|
178
|
-
version_requirements: *id010
|
178
|
+
requirement: *id010
|
179
179
|
- !ruby/object:Gem::Dependency
|
180
180
|
name: equivalent-xml
|
181
|
+
type: :runtime
|
181
182
|
prerelease: false
|
182
|
-
|
183
|
+
version_requirements: &id011 !ruby/object:Gem::Requirement
|
183
184
|
none: false
|
184
185
|
requirements:
|
185
186
|
- - ">="
|
@@ -188,12 +189,12 @@ dependencies:
|
|
188
189
|
segments:
|
189
190
|
- 0
|
190
191
|
version: "0"
|
191
|
-
|
192
|
-
version_requirements: *id011
|
192
|
+
requirement: *id011
|
193
193
|
- !ruby/object:Gem::Dependency
|
194
194
|
name: facets
|
195
|
+
type: :runtime
|
195
196
|
prerelease: false
|
196
|
-
|
197
|
+
version_requirements: &id012 !ruby/object:Gem::Requirement
|
197
198
|
none: false
|
198
199
|
requirements:
|
199
200
|
- - ">="
|
@@ -202,28 +203,28 @@ dependencies:
|
|
202
203
|
segments:
|
203
204
|
- 0
|
204
205
|
version: "0"
|
205
|
-
|
206
|
-
version_requirements: *id012
|
206
|
+
requirement: *id012
|
207
207
|
- !ruby/object:Gem::Dependency
|
208
208
|
name: rubydora
|
209
|
+
type: :runtime
|
209
210
|
prerelease: false
|
210
|
-
|
211
|
+
version_requirements: &id013 !ruby/object:Gem::Requirement
|
211
212
|
none: false
|
212
213
|
requirements:
|
213
214
|
- - "="
|
214
215
|
- !ruby/object:Gem::Version
|
215
|
-
hash:
|
216
|
+
hash: 17
|
216
217
|
segments:
|
217
218
|
- 0
|
218
219
|
- 2
|
219
|
-
-
|
220
|
-
version: 0.2.
|
221
|
-
|
222
|
-
version_requirements: *id013
|
220
|
+
- 3
|
221
|
+
version: 0.2.3
|
222
|
+
requirement: *id013
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: rdf
|
225
|
+
type: :runtime
|
225
226
|
prerelease: false
|
226
|
-
|
227
|
+
version_requirements: &id014 !ruby/object:Gem::Requirement
|
227
228
|
none: false
|
228
229
|
requirements:
|
229
230
|
- - ">="
|
@@ -232,12 +233,12 @@ dependencies:
|
|
232
233
|
segments:
|
233
234
|
- 0
|
234
235
|
version: "0"
|
235
|
-
|
236
|
-
version_requirements: *id014
|
236
|
+
requirement: *id014
|
237
237
|
- !ruby/object:Gem::Dependency
|
238
238
|
name: rdf-rdfxml
|
239
|
+
type: :runtime
|
239
240
|
prerelease: false
|
240
|
-
|
241
|
+
version_requirements: &id015 !ruby/object:Gem::Requirement
|
241
242
|
none: false
|
242
243
|
requirements:
|
243
244
|
- - ">="
|
@@ -246,12 +247,12 @@ dependencies:
|
|
246
247
|
segments:
|
247
248
|
- 0
|
248
249
|
version: "0"
|
249
|
-
|
250
|
-
version_requirements: *id015
|
250
|
+
requirement: *id015
|
251
251
|
- !ruby/object:Gem::Dependency
|
252
252
|
name: yard
|
253
|
+
type: :development
|
253
254
|
prerelease: false
|
254
|
-
|
255
|
+
version_requirements: &id016 !ruby/object:Gem::Requirement
|
255
256
|
none: false
|
256
257
|
requirements:
|
257
258
|
- - ">="
|
@@ -260,12 +261,12 @@ dependencies:
|
|
260
261
|
segments:
|
261
262
|
- 0
|
262
263
|
version: "0"
|
263
|
-
|
264
|
-
version_requirements: *id016
|
264
|
+
requirement: *id016
|
265
265
|
- !ruby/object:Gem::Dependency
|
266
266
|
name: RedCloth
|
267
|
+
type: :development
|
267
268
|
prerelease: false
|
268
|
-
|
269
|
+
version_requirements: &id017 !ruby/object:Gem::Requirement
|
269
270
|
none: false
|
270
271
|
requirements:
|
271
272
|
- - ">="
|
@@ -274,12 +275,12 @@ dependencies:
|
|
274
275
|
segments:
|
275
276
|
- 0
|
276
277
|
version: "0"
|
277
|
-
|
278
|
-
version_requirements: *id017
|
278
|
+
requirement: *id017
|
279
279
|
- !ruby/object:Gem::Dependency
|
280
280
|
name: rake
|
281
|
+
type: :development
|
281
282
|
prerelease: false
|
282
|
-
|
283
|
+
version_requirements: &id018 !ruby/object:Gem::Requirement
|
283
284
|
none: false
|
284
285
|
requirements:
|
285
286
|
- - ">="
|
@@ -288,12 +289,12 @@ dependencies:
|
|
288
289
|
segments:
|
289
290
|
- 0
|
290
291
|
version: "0"
|
291
|
-
|
292
|
-
version_requirements: *id018
|
292
|
+
requirement: *id018
|
293
293
|
- !ruby/object:Gem::Dependency
|
294
294
|
name: rcov
|
295
|
+
type: :development
|
295
296
|
prerelease: false
|
296
|
-
|
297
|
+
version_requirements: &id019 !ruby/object:Gem::Requirement
|
297
298
|
none: false
|
298
299
|
requirements:
|
299
300
|
- - ">="
|
@@ -302,12 +303,12 @@ dependencies:
|
|
302
303
|
segments:
|
303
304
|
- 0
|
304
305
|
version: "0"
|
305
|
-
|
306
|
-
version_requirements: *id019
|
306
|
+
requirement: *id019
|
307
307
|
- !ruby/object:Gem::Dependency
|
308
308
|
name: solrizer-fedora
|
309
|
+
type: :development
|
309
310
|
prerelease: false
|
310
|
-
|
311
|
+
version_requirements: &id020 !ruby/object:Gem::Requirement
|
311
312
|
none: false
|
312
313
|
requirements:
|
313
314
|
- - ">="
|
@@ -318,12 +319,12 @@ dependencies:
|
|
318
319
|
- 1
|
319
320
|
- 3
|
320
321
|
version: 1.1.3
|
321
|
-
|
322
|
-
version_requirements: *id020
|
322
|
+
requirement: *id020
|
323
323
|
- !ruby/object:Gem::Dependency
|
324
324
|
name: jettywrapper
|
325
|
+
type: :development
|
325
326
|
prerelease: false
|
326
|
-
|
327
|
+
version_requirements: &id021 !ruby/object:Gem::Requirement
|
327
328
|
none: false
|
328
329
|
requirements:
|
329
330
|
- - ">="
|
@@ -334,12 +335,12 @@ dependencies:
|
|
334
335
|
- 0
|
335
336
|
- 1
|
336
337
|
version: 1.0.1
|
337
|
-
|
338
|
-
version_requirements: *id021
|
338
|
+
requirement: *id021
|
339
339
|
- !ruby/object:Gem::Dependency
|
340
340
|
name: rspec
|
341
|
+
type: :development
|
341
342
|
prerelease: false
|
342
|
-
|
343
|
+
version_requirements: &id022 !ruby/object:Gem::Requirement
|
343
344
|
none: false
|
344
345
|
requirements:
|
345
346
|
- - <
|
@@ -350,12 +351,12 @@ dependencies:
|
|
350
351
|
- 0
|
351
352
|
- 0
|
352
353
|
version: 2.0.0
|
353
|
-
|
354
|
-
version_requirements: *id022
|
354
|
+
requirement: *id022
|
355
355
|
- !ruby/object:Gem::Dependency
|
356
356
|
name: mocha
|
357
|
+
type: :development
|
357
358
|
prerelease: false
|
358
|
-
|
359
|
+
version_requirements: &id023 !ruby/object:Gem::Requirement
|
359
360
|
none: false
|
360
361
|
requirements:
|
361
362
|
- - ">="
|
@@ -366,12 +367,12 @@ dependencies:
|
|
366
367
|
- 9
|
367
368
|
- 8
|
368
369
|
version: 0.9.8
|
369
|
-
|
370
|
-
version_requirements: *id023
|
370
|
+
requirement: *id023
|
371
371
|
- !ruby/object:Gem::Dependency
|
372
372
|
name: ruby-debug
|
373
|
+
type: :development
|
373
374
|
prerelease: false
|
374
|
-
|
375
|
+
version_requirements: &id024 !ruby/object:Gem::Requirement
|
375
376
|
none: false
|
376
377
|
requirements:
|
377
378
|
- - ">="
|
@@ -380,8 +381,7 @@ dependencies:
|
|
380
381
|
segments:
|
381
382
|
- 0
|
382
383
|
version: "0"
|
383
|
-
|
384
|
-
version_requirements: *id024
|
384
|
+
requirement: *id024
|
385
385
|
description: ActiveFedora provides for creating and managing objects in the Fedora Repository Architecture.
|
386
386
|
email:
|
387
387
|
- matt.zumwalt@yourmediashelf.com
|
@@ -688,6 +688,7 @@ files:
|
|
688
688
|
- spec/samples/oral_history_xml.xml
|
689
689
|
- spec/spec.opts
|
690
690
|
- spec/spec_helper.rb
|
691
|
+
- spec/support/mock_fedora.rb
|
691
692
|
- spec/unit/active_fedora_spec.rb
|
692
693
|
- spec/unit/association_proxy_spec.rb
|
693
694
|
- spec/unit/base_active_model_spec.rb
|
@@ -825,6 +826,7 @@ test_files:
|
|
825
826
|
- spec/samples/oral_history_xml.xml
|
826
827
|
- spec/spec.opts
|
827
828
|
- spec/spec_helper.rb
|
829
|
+
- spec/support/mock_fedora.rb
|
828
830
|
- spec/unit/active_fedora_spec.rb
|
829
831
|
- spec/unit/association_proxy_spec.rb
|
830
832
|
- spec/unit/base_active_model_spec.rb
|