Add proxy support
This commit is contained in:
parent
6b57357fc0
commit
108ec0a28e
2 changed files with 15 additions and 0 deletions
|
@ -78,6 +78,11 @@ module CouchRest
|
|||
}
|
||||
end
|
||||
|
||||
# set proxy for RestClient to use
|
||||
def proxy url
|
||||
RestClient.proxy = url
|
||||
end
|
||||
|
||||
# ensure that a database exists
|
||||
# creates it if it isn't already there
|
||||
# returns it after it's been created
|
||||
|
|
|
@ -188,4 +188,14 @@ describe CouchRest do
|
|||
end
|
||||
end
|
||||
|
||||
describe "using a proxy for RestClient connections" do
|
||||
it "should set proxy url for RestClient" do
|
||||
CouchRest.proxy 'http://localhost:8888/'
|
||||
proxy_uri = URI.parse(RestClient.proxy)
|
||||
proxy_uri.host.should eql( 'localhost' )
|
||||
proxy_uri.port.should eql( 8888 )
|
||||
CouchRest.proxy nil
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in a new issue