Escape regex characters in paths to match (#8138)

Merge pull request 8138
This commit is contained in:
Daniel Leidert
2020-04-27 11:21:07 +02:00
committed by GitHub
parent c8c3891cab
commit 47e3644cd5

View File

@@ -32,7 +32,7 @@ class TestConvertible < JekyllUnitTest
assert_equal({}, ret)
end
assert_match(%r!YAML Exception!, out)
assert_match(%r!#{File.join(@base, name)}!, out)
assert_match(%r!#{Regexp.escape(File.join(@base, name))}!, out)
end
should "raise for broken front matter with `strict_front_matter` set" do
@@ -57,7 +57,7 @@ class TestConvertible < JekyllUnitTest
assert_equal({}, ret)
end
assert_match(%r!invalid byte sequence in UTF-8!, out)
assert_match(%r!#{File.join(@base, name)}!, out)
assert_match(%r!#{Regexp.escape(File.join(@base, name))}!, out)
end
should "parse the front matter but show an error if permalink is empty" do