diff options
author | Nick Lewis <nick@puppetlabs.com> | 2011-03-24 14:04:04 -0700 |
---|---|---|
committer | Nick Lewis <nick@puppetlabs.com> | 2011-03-24 14:12:51 -0700 |
commit | 7761acb5acd998d172b04adb8368a6a672fcde25 (patch) | |
tree | 7027119fe1cec18054887b148585c8372d3420cc | |
parent | 357514ceec94df18abf98e5b906b50cb0dcf4cbd (diff) | |
download | puppet-7761acb5acd998d172b04adb8368a6a672fcde25.tar.gz puppet-7761acb5acd998d172b04adb8368a6a672fcde25.tar.xz puppet-7761acb5acd998d172b04adb8368a6a672fcde25.zip |
(#5221) Add test for fix to fileset with trailing separator
Reviewed-By: Pieter van de Bruggen
-rwxr-xr-x | spec/unit/file_serving/fileset_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/file_serving/fileset_spec.rb b/spec/unit/file_serving/fileset_spec.rb index ecc77812c..149c68c4a 100755 --- a/spec/unit/file_serving/fileset_spec.rb +++ b/spec/unit/file_serving/fileset_spec.rb @@ -13,6 +13,14 @@ describe Puppet::FileServing::Fileset, " when initializing" do proc { Puppet::FileServing::Fileset.new("some/file") }.should raise_error(ArgumentError) end + it "should not fail if the path is fully qualified, with a trailing separator" do + path = "/some/path/with/trailing/separator" + path_with_separator = "#{path}#{File::SEPARATOR}" + File.stubs(:lstat).with(path).returns stub('stat') + fileset = Puppet::FileServing::Fileset.new(path_with_separator) + 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) |