add and use 'skip_if_windows' helper method
- add a new helper method to skip tests if on Windows platform - skip those tests that fail due to lack of support for symlinked files on Windows.
This commit is contained in:
parent
e6b9dd1cc1
commit
1852e54d10
|
@ -158,4 +158,11 @@ class JekyllUnitTest < Minitest::Test
|
||||||
str
|
str
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def skip_if_windows(msg = nil)
|
||||||
|
if Utils::Platforms.really_windows?
|
||||||
|
msg ||= "Jekyll does not currently support this feature on Windows."
|
||||||
|
skip msg.to_s.magenta
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -186,6 +186,9 @@ class TestCollections < JekyllUnitTest
|
||||||
end
|
end
|
||||||
|
|
||||||
should "include the symlinked file from site.source in the list of docs" do
|
should "include the symlinked file from site.source in the list of docs" do
|
||||||
|
# no support for including symlinked file on Windows
|
||||||
|
skip_if_windows "Jekyll does not currently support symlinks on Windows."
|
||||||
|
|
||||||
assert_includes @collection.docs.map(&:relative_path), "_methods/um_hi.md"
|
assert_includes @collection.docs.map(&:relative_path), "_methods/um_hi.md"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -82,6 +82,9 @@ class TestEntryFilter < JekyllUnitTest
|
||||||
|
|
||||||
# rubocop:disable Performance/FixedSize
|
# rubocop:disable Performance/FixedSize
|
||||||
should "include only safe symlinks in safe mode" do
|
should "include only safe symlinks in safe mode" do
|
||||||
|
# no support for symlinks on Windows
|
||||||
|
skip_if_windows "Jekyll does not currently support symlinks on Windows."
|
||||||
|
|
||||||
site = Site.new(site_configuration("safe" => true))
|
site = Site.new(site_configuration("safe" => true))
|
||||||
site.reader.read_directories("symlink-test")
|
site.reader.read_directories("symlink-test")
|
||||||
|
|
||||||
|
@ -91,6 +94,9 @@ class TestEntryFilter < JekyllUnitTest
|
||||||
# rubocop:enable Performance/FixedSize
|
# rubocop:enable Performance/FixedSize
|
||||||
|
|
||||||
should "include symlinks in unsafe mode" do
|
should "include symlinks in unsafe mode" do
|
||||||
|
# no support for symlinks on Windows
|
||||||
|
skip_if_windows "Jekyll does not currently support symlinks on Windows."
|
||||||
|
|
||||||
site = Site.new(site_configuration)
|
site = Site.new(site_configuration)
|
||||||
|
|
||||||
site.reader.read_directories("symlink-test")
|
site.reader.read_directories("symlink-test")
|
||||||
|
|
|
@ -55,6 +55,9 @@ class TestTheme < JekyllUnitTest
|
||||||
end
|
end
|
||||||
|
|
||||||
should "return the resolved path when a symlink & resolved path exists" do
|
should "return the resolved path when a symlink & resolved path exists" do
|
||||||
|
# no support for symlinks on Windows
|
||||||
|
skip_if_windows "Jekyll does not currently support symlinks on Windows."
|
||||||
|
|
||||||
expected = File.expand_path("./_layouts", @expected_root)
|
expected = File.expand_path("./_layouts", @expected_root)
|
||||||
assert_equal expected, @theme.send(:path_for, :_symlink)
|
assert_equal expected, @theme.send(:path_for, :_symlink)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue