Render theme-gem root only in development (#9680)

Merge pull request 9680
This commit is contained in:
Ashwin Maroli
2024-09-16 21:10:55 +05:30
committed by GitHub
parent eba4dbcc72
commit 32074ef944
3 changed files with 25 additions and 3 deletions

View File

@@ -22,7 +22,7 @@ class TestThemeDrop < JekyllUnitTest
"dependencies" => [],
"description" => "This is a theme used to test Jekyll",
"metadata" => {},
"root" => theme_dir,
"root" => "",
"version" => "0.1.0",
}
expected.each_key do |key|
@@ -30,5 +30,22 @@ class TestThemeDrop < JekyllUnitTest
assert_equal expected[key], @drop[key]
end
end
should "render gem root only in development mode" do
with_env("JEKYLL_ENV", nil) do
drop = fixture_site("theme" => "test-theme").to_liquid.theme
assert_equal "", drop["root"]
end
with_env("JEKYLL_ENV", "development") do
drop = fixture_site("theme" => "test-theme").to_liquid.theme
assert_equal theme_dir, drop["root"]
end
with_env("JEKYLL_ENV", "production") do
drop = fixture_site("theme" => "test-theme").to_liquid.theme
assert_equal "", drop["root"]
end
end
end
end