summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Cooper <josh@puppetlabs.com>2011-07-27 15:46:43 -0700
committerJacob Helwig <jacob@puppetlabs.com>2011-08-19 13:52:57 -0700
commit04965d7d7a9cd34265d41c5870e6043ff24b3e4d (patch)
tree9d30d9828fcb02ce93a27322136f25a40983e82b
parentf4598ec2fabbab052f8a815290a6aa88c9338e5e (diff)
downloadpuppet-04965d7d7a9cd34265d41c5870e6043ff24b3e4d.tar.gz
puppet-04965d7d7a9cd34265d41c5870e6043ff24b3e4d.tar.xz
puppet-04965d7d7a9cd34265d41c5870e6043ff24b3e4d.zip
(#8663) Drive letters are not valid absolute paths on Windows
One of the file spec tests was attempting to use X: as a fully qualified file path, and the file type was correctly rejecting it, since it is a relative path. This commit changes the spec test to expect the file type to raise an exception. Reviewed-by: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit e0d3f11fc7b580aedec5350dc41a01417d6acd8d)
-rwxr-xr-xspec/unit/type/file_spec.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/spec/unit/type/file_spec.rb b/spec/unit/type/file_spec.rb
index 010b59f78..24141a9ef 100755
--- a/spec/unit/type/file_spec.rb
+++ b/spec/unit/type/file_spec.rb
@@ -305,9 +305,8 @@ describe Puppet::Type.type(:file) do
file[:path].should == "X:/"
end
- it "should add a slash to a drive letter", :'fails_on_windows' => true, :'fails_on_ruby_1.9.2' => true do
- file = Puppet::Type::File.new(:path => "X:")
- file[:path].should == "X:/"
+ it "should not accept a drive letter without a slash", :'fails_on_ruby_1.9.2' => true do
+ lambda { Puppet::Type::File.new(:path => "X:") }.should raise_error(/File paths must be fully qualified/)
end
end