diff options
| author | Luke Kanies <luke@madstop.com> | 2009-02-19 16:09:58 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2009-02-19 17:51:22 -0600 |
| commit | 262937ff6e505bbf86d15500279ff23398f9e1c8 (patch) | |
| tree | 66084a1e14ed86f19982b800f60d332c139c8a36 /spec/unit/util | |
| parent | b800bde30bd5a08f5e222725588062e2bca37a79 (diff) | |
| download | puppet-262937ff6e505bbf86d15500279ff23398f9e1c8.tar.gz puppet-262937ff6e505bbf86d15500279ff23398f9e1c8.tar.xz puppet-262937ff6e505bbf86d15500279ff23398f9e1c8.zip | |
Correctly handling URI escaping throughout the REST process
This means, at the least, that we can now serve files
via REST when they have spaces and other weird characters
in their names.
This involves a small change to many files.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit/util')
| -rwxr-xr-x | spec/unit/util/uri_helper.rb | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/spec/unit/util/uri_helper.rb b/spec/unit/util/uri_helper.rb deleted file mode 100755 index f454a2ced..000000000 --- a/spec/unit/util/uri_helper.rb +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env ruby -# -# Created by Luke Kanies on 2007-10-18. -# Copyright (c) 2007. All rights reserved. - -require File.dirname(__FILE__) + '/../../spec_helper' - -require 'puppet/util/uri_helper' - -describe Puppet::Util::URIHelper, " when converting a key to a URI" do - before do - @helper = Object.new - @helper.extend(Puppet::Util::URIHelper) - end - - it "should return the URI instance" do - URI.expects(:parse).with("file:///myhost/blah").returns(:myuri) - @helper.key2uri("/myhost/blah").should == :myuri - end - - it "should escape the key before parsing" do - URI.expects(:escape).with("mykey").returns("http://myhost/blah") - URI.expects(:parse).with("http://myhost/blah").returns(:myuri) - @helper.key2uri("mykey").should == :myuri - end - - it "should use the URI class to parse the key" do - URI.expects(:parse).with("http://myhost/blah").returns(:myuri) - @helper.key2uri("http://myhost/blah").should == :myuri - end - - it "should set the scheme to 'file' if the key is a fully qualified path" do - URI.expects(:parse).with("file:///myhost/blah").returns(:myuri) - @helper.key2uri("/myhost/blah").should == :myuri - end - - it "should set the host to 'nil' if the key is a fully qualified path" do - URI.expects(:parse).with("file:///myhost/blah").returns(:myuri) - @helper.key2uri("/myhost/blah").should == :myuri - end -end |
