From 7761acb5acd998d172b04adb8368a6a672fcde25 Mon Sep 17 00:00:00 2001 From: Nick Lewis Date: Thu, 24 Mar 2011 14:04:04 -0700 Subject: (#5221) Add test for fix to fileset with trailing separator Reviewed-By: Pieter van de Bruggen --- spec/unit/file_serving/fileset_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) 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) -- cgit