Test case for issue #5192, where Jekyll.sanitized_path strips drive name on Windows incorrectly
This commit is contained in:
parent
0d8796fbe6
commit
23d7929948
|
@ -29,6 +29,19 @@ class TestPathSanitization < JekyllUnitTest
|
|||
Jekyll.sanitized_path(source_dir, "f./../../../../../../files/hi.txt")
|
||||
end
|
||||
|
||||
context "on Windows with absolute path" do
|
||||
setup do
|
||||
@base_path = "D:/demo"
|
||||
@file_path = "D:/demo/_site"
|
||||
allow(Dir).to receive(:pwd).and_return("D:/")
|
||||
end
|
||||
|
||||
should "strip just the clean path drive name" do
|
||||
assert_equal "D:/demo/_site",
|
||||
Jekyll.sanitized_path(@base_path, @file_path)
|
||||
end
|
||||
end
|
||||
|
||||
context "on Windows with file path has matching prefix" do
|
||||
setup do
|
||||
@base_path = "D:/site"
|
||||
|
|
Loading…
Reference in New Issue