Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Philipp Brüll
committed
Mar 29, 2010
1 parent
ac1064f
commit 6cce56f
Showing
11 changed files
with
173 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
module AllegroGraph | ||
|
||
module Proxy | ||
|
||
class Mapping | ||
|
||
attr_reader :resource | ||
|
||
def initialize(resource) | ||
@resource = resource | ||
end | ||
|
||
def path | ||
"#{@resource.path}/mapping" | ||
end | ||
|
||
def create(type, encoding) | ||
parameters = { :type => type, :encoding => encoding } | ||
@resource.request :put, self.path + "/type", :parameters => parameters, :expected_status_code => 204 | ||
true | ||
end | ||
|
||
def delete(type) | ||
parameters = { :type => type } | ||
@resource.request :delete, self.path + "/type", :parameters => parameters, :expected_status_code => 204 | ||
true | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "spec_helper")) | ||
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "..", "lib", "allegro_graph", "proxy", "mapping")) | ||
|
||
describe AllegroGraph::Proxy::Geo do | ||
|
||
before :each do | ||
@server = AllegroGraph::Server.new :username => "test", :password => "test" | ||
@catalog = AllegroGraph::Catalog.new @server, "test_catalog" | ||
@repository = AllegroGraph::Repository.new @catalog, "test_repository" | ||
@mapping = AllegroGraph::Proxy::Mapping.new @repository | ||
end | ||
|
||
describe "path" do | ||
|
||
it "should return the correct path" do | ||
@mapping.path.should == "#{@repository.path}/mapping" | ||
end | ||
|
||
end | ||
|
||
describe "create" do | ||
|
||
it "should return true" do | ||
result = @mapping.create "<time>", "<http://www.w3.org/2001/XMLSchema#dateTime>" | ||
result.should be_true | ||
end | ||
|
||
end | ||
|
||
describe "delete" do | ||
|
||
it "should return true" do | ||
result = @mapping.delete "<time>" | ||
result.should be_true | ||
end | ||
|
||
end | ||
|
||
end |