diff options
author | Nick Lewis <nick@puppetlabs.com> | 2011-05-03 16:18:57 -0700 |
---|---|---|
committer | Nick Lewis <nick@puppetlabs.com> | 2011-05-03 16:26:19 -0700 |
commit | 1f112cd61ff9e9a3b4a27314533ea4a91dcca76e (patch) | |
tree | b8a2bd749591d2279b6987a7b44f5d57c4ca40e6 /spec/unit/file_serving/fileset_spec.rb | |
parent | fded269b8b2487184f7cfc409c3e82daa59f595a (diff) | |
download | puppet-1f112cd61ff9e9a3b4a27314533ea4a91dcca76e.tar.gz puppet-1f112cd61ff9e9a3b4a27314533ea4a91dcca76e.tar.xz puppet-1f112cd61ff9e9a3b4a27314533ea4a91dcca76e.zip |
(#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 <path>'.
Paired-With: Jacob Helwig
Diffstat (limited to 'spec/unit/file_serving/fileset_spec.rb')
-rwxr-xr-x | spec/unit/file_serving/fileset_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/unit/file_serving/fileset_spec.rb b/spec/unit/file_serving/fileset_spec.rb index a369ad39c..41810650a 100755 --- a/spec/unit/file_serving/fileset_spec.rb +++ b/spec/unit/file_serving/fileset_spec.rb @@ -20,6 +20,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) |