summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-21 17:06:34 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-21 17:06:34 +0000
commitea4b9c83810976235d3486d42e22ec8cf279abf1 (patch)
tree47d96c63d4df72bedba65debce315f7601290734 /test
parentc99843a75a837c042d231242896851ff56e91d34 (diff)
downloadpuppet-ea4b9c83810976235d3486d42e22ec8cf279abf1.tar.gz
puppet-ea4b9c83810976235d3486d42e22ec8cf279abf1.tar.xz
puppet-ea4b9c83810976235d3486d42e22ec8cf279abf1.zip
Fixing #285, opened by ericb.
The problem here was that I was not escaping URIs throughout the chain, which I am now doing. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1642 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/types/filesources.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/types/filesources.rb b/test/types/filesources.rb
index 3cc546b40..f121586c3 100755
--- a/test/types/filesources.rb
+++ b/test/types/filesources.rb
@@ -639,6 +639,39 @@ class TestFileSources < Test::Unit::TestCase
# Make sure it doesn't change.
assert_equal("funtest\n", File.read(dest))
end
+
+ # Testing #285. This just makes sure that URI parsing works correctly.
+ def test_fileswithpoundsigns
+ dir = tstdir()
+ subdir = File.join(dir, "#dir")
+ Dir.mkdir(subdir)
+ file = File.join(subdir, "file")
+ File.open(file, "w") { |f| f.puts "yayness" }
+
+ dest = tempfile()
+ source = "file://localhost#{dir}"
+ obj = Puppet::Type.newfile(
+ :path => dest,
+ :source => source,
+ :recurse => true
+ )
+
+ newfile = File.join(dest, "#dir", "file")
+
+ poundsource = "file://localhost#{subdir}"
+
+ sourceobj = path = nil
+ assert_nothing_raised {
+ sourceobj, path = obj.uri2obj(poundsource)
+ }
+
+ assert_equal("/localhost" + URI.escape(subdir), path)
+
+ assert_apply(obj)
+
+ assert(FileTest.exists?(newfile), "File did not get created")
+ assert_equal("yayness\n", File.read(newfile))
+ end
end
# $Id$