diff options
-rw-r--r-- | lib/puppet/indirector/rest.rb | 5 | ||||
-rwxr-xr-x | spec/unit/indirector/rest.rb | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/puppet/indirector/rest.rb b/lib/puppet/indirector/rest.rb index 546cbdaf7..e6a7bd6cf 100644 --- a/lib/puppet/indirector/rest.rb +++ b/lib/puppet/indirector/rest.rb @@ -3,6 +3,11 @@ require 'uri' # Access objects via REST class Puppet::Indirector::REST < Puppet::Indirector::Terminus + + def rest_connection_details + { :host => '127.0.0.1', :port => 34343 } + end + def network_fetch(path) Net::HTTP.start("127.0.0.1", 34343) {|x| x.get("/#{path}").body } end diff --git a/spec/unit/indirector/rest.rb b/spec/unit/indirector/rest.rb index 38ab0d634..dabb928cf 100755 --- a/spec/unit/indirector/rest.rb +++ b/spec/unit/indirector/rest.rb @@ -20,6 +20,18 @@ describe Puppet::Indirector::REST do @searcher = @rest_class.new end + describe "when locating the rest connection" do + it 'should look somewhere meaningful for connection details' + + it "should return a host" do + @searcher.rest_connection_details[:host].should == '127.0.0.1' + end + + it "should return a port" do + @searcher.rest_connection_details[:port].should == 34343 + end + end + describe "when doing a network fetch" do it "should escape the provided path" it "should look up the appropriate remote server" |