summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-08-23 18:15:56 -0500
committerLuke Kanies <luke@madstop.com>2008-08-26 22:40:39 -0700
commitf5ba99fd24ce2e7cdba7c81153c46df14811d193 (patch)
tree909d98edc1a711cbaa5eb19cac420ef6d919666a /spec
parenta215abaef97ea1fb0187f46c5e6a880ff1d29036 (diff)
Special-casing 'file' URIs in the indirection requests.
These just get converted to full file paths, since we know they will never pass over the wire. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/indirector/request.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/unit/indirector/request.rb b/spec/unit/indirector/request.rb
index 2476a3d7f..6169a09b4 100755
--- a/spec/unit/indirector/request.rb
+++ b/spec/unit/indirector/request.rb
@@ -77,6 +77,26 @@ describe Puppet::Indirector::Request do
end
describe "and the request key is a URI" do
+ describe "and the URI is a 'file' URI" do
+ before do
+ @request = Puppet::Indirector::Request.new(:ind, :method, "file:///my/file")
+ end
+
+ it "should set the request key to the full file path" do @request.key.should == "/my/file" end
+
+ it "should not set the protocol" do
+ @request.protocol.should be_nil
+ end
+
+ it "should not set the port" do
+ @request.port.should be_nil
+ end
+
+ it "should not set the server" do
+ @request.server.should be_nil
+ end
+ end
+
it "should set the protocol to the URI scheme" do
Puppet::Indirector::Request.new(:ind, :method, "http://host/stuff").protocol.should == "http"
end
@@ -98,7 +118,7 @@ describe Puppet::Indirector::Request do
Puppet::Indirector::Request.new(:ind, :method, "http://host/stuff").port.should == 80
end
- it "should set the request key to the path from the URI" do
+ it "should set the request key to the unqualified path from the URI" do
Puppet::Indirector::Request.new(:ind, :method, "http:///stuff").key.should == "stuff"
end