Skip to content

Commit 8b0aac2

Browse files
committed
Add another test case for having a trailing slash for unix path
If a trailing path exists in the original input, should keep it. This test case should verify that.
1 parent 2be0b84 commit 8b0aac2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spec/lib/rex/file_utils_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
described_class.normalize_unix_path('/etc/passwd').should eq('/etc/passwd')
4646
end
4747

48+
it "should still give me a trailing slash if I have it" do
49+
described_class.normalize_unix_path('/etc/folder/').should eq("/etc/folder/")
50+
end
51+
4852
it "should convert a path without double slashes" do
4953
described_class.normalize_unix_path('//etc////passwd').should eq("/etc/passwd")
5054
described_class.normalize_unix_path('/etc////', 'passwd').should eq('/etc/passwd')

0 commit comments

Comments
 (0)