From 90eb937a093b6dd962ee136a4e6f84cfa3ba72cd Mon Sep 17 00:00:00 2001 From: Nick Lewis Date: Tue, 3 May 2011 16:18:57 -0700 Subject: (#7139) Accept '/' as a valid path in filesets This was unconditionally removing the trailing file separator ('/'), which is only valid when the file separator isn't the entire path. This fixes 'puppet resource file '. Paired-With: Jacob Helwig --- spec/unit/file_serving/fileset_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec') diff --git a/spec/unit/file_serving/fileset_spec.rb b/spec/unit/file_serving/fileset_spec.rb index 149c68c4a..6b41e8a74 100755 --- a/spec/unit/file_serving/fileset_spec.rb +++ b/spec/unit/file_serving/fileset_spec.rb @@ -21,6 +21,13 @@ describe Puppet::FileServing::Fileset, " when initializing" do fileset.path.should == path end + it "should not fail if the path is just the file separator" do + path = File::SEPARATOR + File.stubs(:lstat).with(path).returns stub('stat') + fileset = Puppet::FileServing::Fileset.new(path) + fileset.path.should == path + end + it "should fail if its path does not exist" do File.expects(:lstat).with("/some/file").returns nil proc { Puppet::FileServing::Fileset.new("/some/file") }.should raise_error(ArgumentError) -- cgit