agraph 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -3
- data/lib/allegro_graph.rb +14 -5
- data/lib/allegro_graph/catalog.rb +0 -1
- data/lib/allegro_graph/extended_transport.rb +84 -0
- data/lib/allegro_graph/proxy.rb +13 -0
- data/lib/allegro_graph/proxy/statements.rb +0 -1
- data/lib/allegro_graph/repository.rb +6 -20
- data/lib/allegro_graph/resource.rb +22 -0
- data/lib/allegro_graph/server.rb +0 -8
- data/lib/allegro_graph/session.rb +2 -16
- data/lib/allegro_graph/transport.rb +0 -80
- data/lib/allegro_graph/utility.rb +10 -0
- data/spec/fake_transport.yml +0 -27
- data/spec/integration/geo_spatial_spec.rb +137 -0
- data/spec/integration/mapping_spec.rb +56 -0
- data/spec/integration/query_spec.rb +47 -0
- data/spec/integration/repository_spec.rb +53 -0
- data/spec/integration/server_spec.rb +20 -0
- data/spec/integration/statements_spec.rb +67 -0
- data/spec/integration/transactions_spec.rb +39 -0
- data/spec/lib/allegro_graph/extended_transport_spec.rb +59 -0
- data/spec/lib/allegro_graph/resource_spec.rb +26 -0
- data/spec/lib/allegro_graph/server_spec.rb +1 -13
- data/spec/lib/allegro_graph/transport_spec.rb +0 -57
- data/spec/spec_helper.rb +1 -0
- metadata +16 -6
- data/lib/allegro_graph/federation.rb +0 -74
- data/spec/integration/basic_spec.rb +0 -406
- data/spec/lib/allegro_graph/federation_spec.rb +0 -113
@@ -1,113 +0,0 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "spec_helper"))
|
2
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "lib", "allegro_graph", "federation"))
|
3
|
-
|
4
|
-
describe AllegroGraph::Federation do
|
5
|
-
|
6
|
-
before :each do
|
7
|
-
@server = AllegroGraph::Server.new :username => "test", :password => "test"
|
8
|
-
@federation = AllegroGraph::Federation.new @server,
|
9
|
-
"test_federation",
|
10
|
-
:repository_names => [ "test_repository" ],
|
11
|
-
:repository_urls => [ "http://username:password@server:10035/repositories/another" ]
|
12
|
-
end
|
13
|
-
|
14
|
-
describe "==" do
|
15
|
-
|
16
|
-
it "should be true when comparing two equal federations" do
|
17
|
-
other = AllegroGraph::Federation.new @server, "test_federation"
|
18
|
-
@federation.should == other
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should be false when comparing two different federations" do
|
22
|
-
other = AllegroGraph::Federation.new @server, "other_federationy"
|
23
|
-
@federation.should_not == other
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
describe "request" do
|
29
|
-
|
30
|
-
before :each do
|
31
|
-
@server.stub!(:request)
|
32
|
-
end
|
33
|
-
|
34
|
-
it "should call the server's request method" do
|
35
|
-
@server.should_receive(:request).with(:get, "/", { })
|
36
|
-
@federation.request :get, "/"
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
describe "exists?" do
|
42
|
-
|
43
|
-
context "for a federation that already exists" do
|
44
|
-
|
45
|
-
it "should return true" do
|
46
|
-
@federation.exists?.should be_true
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
context "for a federation that not exists" do
|
52
|
-
|
53
|
-
before :each do
|
54
|
-
@federation.name = "not_existing"
|
55
|
-
end
|
56
|
-
|
57
|
-
it "should return false" do
|
58
|
-
@federation.exists?.should be_false
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|
62
|
-
|
63
|
-
end
|
64
|
-
|
65
|
-
describe "create!" do
|
66
|
-
|
67
|
-
it "should return true" do
|
68
|
-
@federation.create!.should be_true
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|
72
|
-
|
73
|
-
describe "create_if_missing!" do
|
74
|
-
|
75
|
-
it "should do nothing if the federation already exists" do
|
76
|
-
@federation.stub!(:exists?).and_return(true)
|
77
|
-
@federation.should_not_receive(:create!)
|
78
|
-
@federation.create_if_missing!
|
79
|
-
end
|
80
|
-
|
81
|
-
it "should call create! if the federation doesn't exists" do
|
82
|
-
@federation.stub!(:exists?).and_return(false)
|
83
|
-
@federation.should_receive(:create!)
|
84
|
-
@federation.create_if_missing!
|
85
|
-
end
|
86
|
-
|
87
|
-
end
|
88
|
-
|
89
|
-
describe "delete!" do
|
90
|
-
|
91
|
-
it "should return true" do
|
92
|
-
@federation.delete!.should be_true
|
93
|
-
end
|
94
|
-
|
95
|
-
end
|
96
|
-
|
97
|
-
describe "delete_if_exists!" do
|
98
|
-
|
99
|
-
it "should call delete! if the federation already exists" do
|
100
|
-
@federation.stub!(:exists?).and_return(true)
|
101
|
-
@federation.should_receive(:delete!)
|
102
|
-
@federation.delete_if_exists!
|
103
|
-
end
|
104
|
-
|
105
|
-
it "should do nothing if the federation doesn't exists" do
|
106
|
-
@federation.stub!(:exists?).and_return(false)
|
107
|
-
@federation.should_not_receive(:delete!)
|
108
|
-
@federation.delete_if_exists!
|
109
|
-
end
|
110
|
-
|
111
|
-
end
|
112
|
-
|
113
|
-
end
|