forked from pius/rdf-mongo
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmongo_repository_spec.rb
40 lines (34 loc) · 1.03 KB
/
mongo_repository_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$:.unshift "."
require 'spec_helper'
require 'rdf/spec/repository'
require 'rdf/mongo'
describe RDF::Mongo::Repository do
before :all do
logger = RDF::Spec.logger
logger.level = Logger::FATAL
@load_durable = lambda {RDF::Mongo::Repository.new uri: "mongodb://localhost:27017/rdf-mongo/specs", logger: logger}
@repository = @load_durable.call
end
before :each do
@repository.collection.drop
end
after :each do
@repository.collection.drop
end
# @see lib/rdf/spec/repository.rb in RDF-spec
it_behaves_like "an RDF::Repository" do
let(:repository) {@repository}
end
context "problemantic examples" do
subject {@repository}
{
"Insert key too large to index" => %(
<http://repository.librario.de/publications/0cbdc7f4-728d-4f85-ab09-01060c7b2922> <http://purl.org/ontology/bibo/abstract> "#{'a' * 1001}" .
)
}.each do |name, nt|
it name do
expect {subject << RDF::Graph.new << RDF::NTriples::Reader.new(nt)}.not_to raise_error
end
end
end
end